One cached series. Plain JSON: safe to persist as-is.

interface CachedBars {
    bars: Bar[];
    from: number;
    nextClose: number;
    storedAt: number;
    to: number;
    version?: number;
}

Properties

bars: Bar[]

Closed bars only, ascending by time.

from: number

Coverage start: the from of the request that filled this entry.

nextClose: number

When the bar AFTER this entry's coverage closes, so freshness needs no re-resolve. Null is impossible here: an entry whose bars have no knowable close is never stored in the first place.

storedAt: number

Wall clock (ms) at store time, for TTL.

to: number

Coverage end (inclusive): the last instant this entry is complete to.

version?: number

Persisted schema version. Missing means the compatible legacy schema.