options.volume
Adds call and put contract-volume columns to an immutable query builder. Calling .volume() without arguments selects both sides.
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
.volume(['call'])
.for({
coins: ['BTC'],
})
.over({
last: '1D',
resolution: '1h',
}),
);
const rows = data.rows();Definition
function volume(): OptionsBuilder<C | OptionsVolumeColumn>;
function volume<P extends OptionsVolumePart>(
parts: readonly P[],
): OptionsBuilder<C | OptionsVolumeColumn<P>>;Parameters
parts
- Type:
readonly OptionsVolumePart[] - Optional
- Default:
['call', 'put']
| Part | Selected column |
|---|---|
call | call_volume |
put | put_volume |
Return Type
- Type:
OptionsBuilder<C | OptionsVolumeColumn<P>>
Returns a builder typed with the accumulated columns.