client.volatility() when you need realized volatility data for risk modeling and intraperiod volatility analysis. This method calculates volatility metrics 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 |
| method | str | No | Calculation method: "log_returns" (default) |
| limit | int | No | Page size (default: 1000) |
POLARIS_API_KEY environment variable or pass api_key to PolarisClient().
Return value
List of bucketed realized volatility series rows.Example response
Fields
Volatility records include:timestamp: bucket start time in UTC microseconds since the Unix epochvenue: exchange identifiersymbol: normalized instrument symbolvolatility: realized volatility for the interval (decimal, e.g., 0.0234 = 2.34%)interval: duration token such as1m,5m, or1h
Example
How it works
client.volatility() calculates realized volatility 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 volatility metrics from the underlying trade events.
For more details on snapshot-based queries, see Snapshots.
Related documentation
- OHLCV if you need price data for volatility calculations
- Trades if you need execution-level data
- Authentication