Skip to content
Velo

futures.for

Defines which markets to query. Choose exactly one of coins or products, and optionally select specific exchanges (omit for all exchanges).

The .for() step is required before a request can be executed.

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
    .price(['close'])
    .for({
      exchanges: ['binance-futures', 'bybit'],
      coins: ['BTC'],
    })
    .over({
      last: '1D',
      resolution: '1h',
    }),
);

Omitting exchanges selects every futures exchange:

futures.price(['close']).for({ coins: ['BTC'] });

Definition

function for(scope: MarketScope<FuturesExchange>): FuturesBuilder;

Parameters

scope.coins / scope.products

  • Type: readonly string[]

Provide exactly one of the two.

Use coins for Velo-aggregated symbols, products for exchange-specific symbols.

scope.exchanges

  • Type: readonly FuturesExchange[]
  • Optional
  • Default: every futures exchange

When given, the returned row type narrows to exactly the exchanges selected.

Return Type

  • Type: FuturesBuilder

Returns a builder with the market scope recorded. Call .over() to add the time window.