Resolutions
CandleResolution is the SDK’s own vocabulary for bar sizes — not any single provider’s:
type CandleResolution =
| "1s"
| "10s"
| "1m"
| "3m"
| "5m"
| "10m"
| "15m"
| "30m"
| "1h"
| "2h"
| "4h"
| "6h"
| "8h"
| "12h"
| "1d"
| "3d"
| "1w"
| "1M";A CandleSource maps these onto its native interval strings and declares the subset it can actually serve via supportedResolutions — no venue supports all of them. Binance futures, for instance, has neither 1s nor 10s; Binance spot serves 1s but not 10s. Neither Binance market supports 10m. Its presence in the SDK vocabulary does not add that interval to a source.
resolutionToMs
Nominal length of a resolution in milliseconds.
import { resolutionToMs } from "@symmio/trading-core";
resolutionToMs("5m"); // 300_000
resolutionToMs("10m"); // 600_000numberThrows UNKNOWN_CANDLE_RESOLUTION when given a code outside the vocabulary.
CANDLE_RESOLUTION_MS
The underlying table, Record<CandleResolution, number>.
1w and 1M are calendar units — a month is not a fixed span. The values here use nominal 7-day and 30-day lengths
for estimating a request’s span. Do not use the nominal month length for calendar alignment or lossless time-window
pagination; use the source’s calendar rules.
Per-venue translation
Each venue integration ships its own mapping in and out of this vocabulary:
toBinanceInterval/getBinanceSupportedResolutions— Binance interval strings.toTradingViewResolution/fromTradingViewResolution— TradingView’s resolution codes ("1h"↔"60").
Lowcap price-service resolutions
createLowcapCandleSource serves 1m, 5m, 10m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 1w, and 1M. The final three map to service timeframes 1D, 1W, and 1M. Weekly buckets start Monday at 00:00 UTC; monthly buckets start on the first day of the calendar month. The source uses calendar arithmetic for paging, not the nominal millisecond duration of a month.
Related
CandleSource— wheresupportedResolutionsis declared.getCandlesQueryOptions— the read these resolutions parameterize.