[WIP] - backfill missing scripts #8432
Draft
+350
−90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to allow retrieving missing data across all adapters used by dimensions (options, derivatives, dexs, fees, etc.)
Required
Already done:
It is currently a WIP, but as it stands, it enables, through the script
npm run checkMissingDimensions
, retrieving all available data in the DB and identifying adapters with gaps, days with data equal to zero, and days with negative data, which is nonsensical (volume and fees cannot naturally be negative)The results are currently in CSV format sorted by Adapter Type but could be adjusted for automation purposes. They are presented as follows (mainly for dev-mode/debug):
For example this command
npm run backfill-local aggregators 'Hinkal' onlyMissing=true timestamps=1699315200,1699401600
allows a manual backfill attempt for the identified missing days.The backfill function has also been modified. It now supports:
npm run backfill-local {type} {adapterName} {onlyMissing}
-> Retrieves all missing data from the last 30 days by default.npm run backfill-local {type} {adapterName} {onlyMissing} timestamp=x
-> Retrieves all missing data from the specified timestamp up to today.npm run backfill-local {type} {adapterName} {onlyMissing} timestamp=x endTimestamp=y
-> Retrieves all missing data over a given interval.npm run backfill-local {type} {adapterName} {onlyMissing} timestamps=x,y,z
-> Retrieves specific timestamps without requiring continuity between them."