messari / subgraphs

Standardized subgraphs for blockchain data
MIT License
508 stars 239 forks source link

#bug; gaps in timeseries #1703

Open melotik opened 1 year ago

melotik commented 1 year ago

Describe the bug Currently our timeseries data has gaps in it. It is usually the market snapshots. If there is no activity in a market in a given day we do not create the snapshot. Originally we did this to not show any stale data.

Expected behavior Going forward we want to remove any gaps in the timeseries. Options and potential downsides:

melotik commented 1 year ago

Another question I want to pose, when there are still gaps in snapshots: Do we want to fill in stale data or do we want to let the user make the assumptions when they process the data? There are 3ish ways you can go about the retrospective snapshot creations:

  1. Use the newest data from the latest snapshot
  2. Average the data from the last/latest snapshot
  3. Use the data from the last snapshot before the gap
melotik commented 1 year ago

There are 2 solutions to fix it, both have drawbacks:

  1. If there is no activity in a protocol on a given day should we retrospectively create snapshots that have stale data. Personally I don’t think we should have stale data in subgraphs and if that is the case we should not create a snapshot.

  2. We watch an active event that we know for sure will execute x blocks and we can use it to ensure we have fresh data even when there is no activity in the protocol. This will slow down syncing. Depending on how active the event is will determine how significant.