vike-io

vike-futures-basis

What a dated future pays over spot - every live quarterly, monthly, weekly and daily future on Binance (USDT-M and COIN-M), Bybit, OKX, Deribit, Gate and Kraken, priced against the index, the venue's spot or its perpetual, with the basis and the annualised cash-and-carry yield to expiry, volume and open interest, sorted by yield or by expiry. Use when the user asks "what is the BTC basis" / "annualized yield of the March BTC future" / "cash and carry on ETH" / "which exchange's quarterly pays the most" / "is the futures curve in contango" / "how far above spot is the December future".

vike-io 2 Updated 2d ago
GitHub

Install

npx skillscat add vike-io/vike-data-cli/vike-futures-basis

Install via the SkillsCat registry.

SKILL.md

vike-futures-basis

The newest quote (taken about once a minute) of every live dated future, against the underlying. 1 request per call. Pass the base asset (BTC, not BTCUSDT); venues are lower case. It is a snapshot: there is no basis history.

Call it

Use the first of these that is available:

  1. MCP: the futures_basis tool with the optional symbol, exchange, ref, sort, limit.
  2. CLI:
    vike-data md basis BTC --json                              # every live BTC future, highest apr first, against the index
    vike-data md basis ETH --sort expiry --json                # the ETH curve, soonest expiry first
    vike-data md basis BTC --exchange binance --ref spot --json    # Binance's BTC futures against Binance spot
    vike-data md basis --exchange okx --json                   # every coin OKX lists dated futures for
  3. curl: the credential is VIKE_API_KEY, else api_key or anon_token from ~/.vike/config.json (Windows %USERPROFILE%\.vike\config.json); with none, get a free anonymous token as vike-core says.
    curl -s "https://data.vike.io/v1/marketdata/futures/basis?symbol=BTC&sort=expiry" -H "X-API-KEY: $TOKEN"
Flag Default Values
[symbol] every coin base asset: BTC, ETH, SOL, XRP, BNB, DOGE ...
--exchange every venue binance, bybit, okx, deribit, gate, kraken
--ref index index (the index the contract settles on), spot (the same venue's spot pair), perp (the same venue's perpetual)
--sort apr apr (highest first, null last) or expiry (soonest first)
--limit 500 1-5000 rows

Reading the answer

The envelope is {symbol, exchange, ref, sort, notes, futures}; notes defines every field in words. Each row in futures:

  • exchange, symbol, instrument (the venue's name: BTCUSDT_270326, BTC-25DEC26, BTC_USDC-4DEC26), expiry (unix seconds), days_to_expiry;
  • type: linear (worth contract_size coins) or inverse (coin-margined, worth contract_size USD), and settle (USDT, USDC, USD, BTC);
  • price and price_src: the book mid when bid and ask are within 1 % (mid), else the venue's mark (mark), else the last trade (last); last, mark, bid, ask are there too;
  • index_price, spot_price, perp_price (null where the venue lists none) and ref_price (the one --ref picked);
  • basis = (price - ref_price) / ref_price, a fraction: 0.0054 is 0.54 %;
  • apr = basis x 365 / days_to_expiry, a fraction: what buying the underlying and selling the future earns a year if held to expiry, before fees. null under 2 days to expiry;
  • vol_24h_usd, oi_usd (0 where the venue gives none), ts and age_s of the quote.

How to read it:

  • Quote basis next to apr. A 0.1 % basis 2.3 days out reads as 16 % a year; it is 0.1 % earned once.
  • Check liquidity before citing a top row. Sorted by apr, the top is often a thin Gate or Kraken contract (about $15,000-24,000 of daily volume on 2026-12-02; Gate's priced at its mark, its bid-ask several percent wide). Prefer rows with price_src: mid, real vol_24h_usd and oi_usd.
  • The curve: --sort expiry lists one venue's expiries in order. Rising basis with expiry and positive apr is contango (futures above spot); a negative basis is backwardation.
  • Unlike perp funding, this yield is fixed at entry if held to expiry. A sold future's basis can widen before expiry: a mark-to-market loss on the way.
  • To compare with what a perpetual pays instead, run vike-perp-carry (md carry, cross-venue perp pairs) or vike-perp-funding (md funding-now <SYM>, each venue's funding as apr).

Limits

  • --ref spot has no spot on Deribit or Kraken: those rows come back with ref_price, basis and apr null. Use the default index there.
  • Deribit lists daily expiries: they fall under 2 days and keep apr null, which is by design.
  • Only live contracts quoted in the last 10 minutes are listed; a coin with no dated future returns an empty futures list.
  • spot_price and perp_price are USDT-quoted, so against a USD-quoted inverse future they carry the small USDT/USD difference.

Errors

  • A 400 names the fix, e.g. ref must be one of ['index', 'spot', 'perp'], sort must be one of ['apr', 'expiry']. The CLI exits 1 with that message.
  • unknown query parameter (curl): the route takes only symbol, exchange, ref, sort, limit.
  • Exit code 3 or HTTP 429: the day's requests are used up; show the server's message and stop.

Anti-patterns

  • Don't read apr 0.047 as 0.047 %: it is 4.7 % a year.
  • Don't present the highest apr row as the trade without its volume, open interest and price_src.
  • Don't call it risk-free: the two legs need margin, an inverse contract's hedge is held in coins, and fees are not taken off.
  • Don't promise a basis history or a chart: this answers now only.

Pairs well with

  • vike-perp-carry for cross-venue perp and spot-perp carry after fees
  • vike-perp-funding for each venue's perpetual funding of the same coin
  • vike-options-flow for what Deribit option traders are buying on the same expiries