Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] - backfill missing scripts #8432

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

0xpeluche
Copy link

@0xpeluche 0xpeluche commented Oct 29, 2024

This PR aims to allow retrieving missing data across all adapters used by dimensions (options, derivatives, dexs, fees, etc.)

Required

TVL_CACHE_DB_HOST=
TVL_CACHE_DB_PORT=
TVL_CACHE_DB_NAME=
TVL_CACHE_DB_USERNAME=
TVL_CACHE_DB_PASSWORD=
TVL_CACHE_DB_HOST_INTERNAL=
GRAPH_API_KEY=
DUNE_API_KEYS=
INDEXA_DB=
ALLIUM_API_KEY=

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):

Panora,"1707350400,1712016000,1712102400",aggregators,"npm run backfill-local aggregators 'Panora' onlyMissing=true timestamps=1707350400,1712016000,1712102400"

Hinkal,"1699315200,1699401600",aggregators,"npm run backfill-local aggregators 'Hinkal' onlyMissing=true timestamps=1699315200,1699401600"

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."

@0xpeluche 0xpeluche self-assigned this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant