futures.trades
Adds futures trade-count columns to an immutable query builder. Calling .trades() without arguments selects buy, sell, and total trade counts.
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
.trades(['buy', 'sell'])
.for({
products: ['BTCUSDT'],
})
.over({
last: '1D',
resolution: '1h',
}),
);
const rows = data.rows();Definition
function trades(): FuturesBuilder<C | FuturesTradeColumn>;
function trades<P extends FuturesTradePart>(
parts: readonly P[],
): FuturesBuilder<C | FuturesTradeColumn<P>>;Parameters
parts
- Type:
readonly FuturesTradePart[] - Optional
- Default:
['buy', 'sell', 'total']
| Part | Selected column |
|---|---|
buy | buy_trades |
sell | sell_trades |
total | total_trades |
Return Type
- Type:
FuturesBuilder<C | FuturesTradeColumn<P>>
Returns a builder typed with the accumulated columns.