Skip to content
Velo

options.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, options } from 'velo-sdk';
 
const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
 
const data = await velo.query(
  options
    .iv(['1m'])
    .for({
      exchanges: ['deribit'],
      coins: ['BTC'],
    })
    .over({
      last: '1D',
      resolution: '1h',
    }),
);

Omitting exchanges selects every options exchange:

options.iv(['1m']).for({ coins: ['BTC'] });

Definition

function for(scope: MarketScope<OptionsExchange>): OptionsBuilder;

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 OptionsExchange[]
  • Optional
  • Default: every options exchange

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

Return Type

  • Type: OptionsBuilder

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