futures.over
Defines the time window to query. Choose exactly one of between or last, and select a resolution.
The .over() step is required before a request can be executed.
Imports
import { Velo } from 'velo-sdk';Examples
const data = await velo.query(
futures
.price(['close'])
.for({ coins: ['BTC'] })
.over({
last: '1D',
resolution: '1h',
}),
);const data = await velo.query(
futures
.price(['close'])
.for({ coins: ['BTC'] })
.over({
between: [
new Date('2026-01-01T00:00:00Z'),
new Date('2026-02-01T00:00:00Z'),
],
resolution: '4h',
}),
);Definition
function over(scope: WindowScope): FuturesBuilder;Parameters
scope.between / scope.last
- Type:
readonly [number | Date, number | Date](between) orLastDuration(last)
Provide exactly one of the two.
betweenis a[begin, end)pair ofDateobjects or millisecond timestampslastis a trailing duration in minutes, hours, days, or weeks:30m,2h,3D,1W. It is anchored when the request is executed
scope.resolution
- Type:
Resolution
Return Type
- Type:
FuturesBuilder
Returns a builder with the time window recorded. Pass it to velo.query() or velo.stream().