Skip to content
Velo

channels.tape

Builds a channel for live futures buy and sell trade counts. Accepts a product on one exchange or a coin across exchanges. Pass it to velo.channels.feed() with a data listener to receive updates.

Imports

import { Velo } from 'velo-sdk';

Example

const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
const product = {
  exchange: 'binance-futures',
  coin: 'BTC',
  product: 'BTCUSDT',
} as const;
 
const single = velo.channels.tape(product).on({
  data: (row) => console.log(row.time, row.buy_trades),
  error: ({ reason }) => console.error('Channel error:', reason),
});
 
const aggregated = velo.channels.tape({ coin: product.coin }).on({
  data: (entries) => console.table(entries),
  error: ({ reason }) => console.error('Aggregated channel error:', reason),
});
 
const watcher = await velo.watch(velo.channels.feed([single, aggregated]), {
  on: { error: (error) => console.error('Connection error:', error) },
});
 
// Later:
watcher.close();

Definition

Simplified signature. The SDK infers the returned channel's data type from the target.

function tape(target: Target<FuturesExchange>): Channel;

Parameters

target

  • Type: Target<FuturesExchange>
  • Required

A futures product with exchange, coin, and product, as returned by the catalog. Pass { coin } on its own for an aggregated channel across futures exchanges.

Return Type

  • Type: Channel

Returns a channel typed with the selected target.

FieldDescription
buy_tradesNumber of buy trades so far in the minute
sell_tradesNumber of sell trades so far in the minute
{
  "exchange": "binance-futures",
  "coin": "BTC",
  "product": "BTCUSDT",
  "time": 1785160560000,
  "buy_trades": 120,
  "sell_trades": 95
}