Description
The class in timeSeries.ts
is currently being used to aggregate event-level data in intervals called TimeFrames
.
These come close to the concept of "Candlestick" data, and I propose to rename them accordingly due to the misleading naming as "TimeSeries" which simply means:
A time series is a sequence of data points that occur in successive order over some period of time.
In my latest work on integrating SPL Lending program's instructions into the TokenSnapshot indexer, I have the requirement to efficiently aggregate all events such that a linked and aggregated data point will be created for every event to receive tick-level data. A tick describes:
A tick is a measure of the minimum upward or downward movement in the price of a security. A tick can also refer to the change in the price of a security from one trade to the next trade.
Suggested changes
- Following the latter definition, I would suggest implementing a new type of stats aggregator:
TickStats
for event-level aggregation of statistics. - The previously called
TimeSeriesStats
and all related classes/variables could be renamed toCandlestickStats
, to appeal to DeFi users, or more generally,IntervalStats
.
Note: These two steps should be conducted in two separate PRs.