client.vwap() when you need volume-weighted average price data for execution benchmarking and price smoothing. This method calculates VWAP over fixed time intervals.
Method signature
Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
| source | str | Yes | Source ID |
| market | str | Yes | Normalized market or instrument ID |
| from_ | str/datetime/date/int | Yes | Inclusive start time (ISO 8601, datetime, date, or epoch microseconds) |
| to | str/datetime/date/int | Yes | Exclusive end time (same formats as from_) |
| interval | str | Yes | Duration token such as 1m, 5m, 1h |
| limit | int | No | Page size (default: 1000) |
POLARIS_API_KEY environment variable or pass api_key to PolarisClient().
Return value
List of bucketed VWAP series rows.Example response
Fields
VWAP records include:timestamp: bucket start time in UTC microseconds since the Unix epochvenue: exchange identifiersymbol: normalized instrument symbolvwap: volume-weighted average price for the intervalvolume: total traded base volume for the intervalinterval: duration token such as1m,5m, or1h
Example
How it works
client.vwap() calculates VWAP from standardized trade data using snapshot-first replay. The SDK queries the /snapshots endpoint for historical data, reads from local cached files when available, and derives VWAP from the underlying trade events.
For more details on snapshot-based queries, see Snapshots.
Related documentation
- OHLCV if you need price data alongside volume
- Volume if you only need volume profiles
- Trades if you need execution-level data
- Authentication