Skip to content
Velo

futures.basis

Creates an immutable builder for the annualized basis of the rolling futures contract expiring closest to three months in the future.

Imports

import { Velo } from 'velo-sdk';

Examples

import { Velo, futures } from 'velo-sdk';
 
const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
 
const data = await velo.query(
  futures
    .basis()
    .coins(['BTC'])
    .over({
      last: '1D',
    resolution: '1h',
    }),
);
 
const rows = data.rows();

The .coins() call is optional. When omitted, the query includes both BTC and ETH.

Definition

function basis(): FuturesBasisBuilder;

Parameters

None.

Return Type

  • Type: FuturesBasisBuilder

Returns an immutable builder with the following methods:

MethodDescription
.coins(coins)Selects BTC, ETH, or both. Defaults to both coins.
.over(scope)Selects the time window and resolution. Required.

Pass the request to velo.query() to resolve Data<FuturesExchange, '3m_basis_ann'>, or to velo.stream() to receive rows one at a time.

Basis takes no .for() step: it selects coins directly, and the API always serves it across the exchanges used for the basis calculation.