feat: add Hyperliquid S3 archive backfill pipeline (blocked: data not public)#830
Open
feat: add Hyperliquid S3 archive backfill pipeline (blocked: data not public)#830
Conversation
…ta gaps Two-stage pipeline to backfill sparse vault history from the hyperliquid-archive S3 bucket (daily account_values snapshots): Stage 1 (extract): Parse LZ4-compressed CSV files, filter vault rows, store in staging DuckDB. Resumable — skips already-processed dates. Stage 2 (apply): Insert missing dates into main daily-metrics DuckDB, recompute share prices. Only fills gaps, never overwrites API data. Each row tagged with data_source='s3_backfill' for provenance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI does not install the hyperliquid_backfill extra, so lz4 is missing. Use pytest.importorskip to gracefully skip the test module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…xtract script - Add configure_aws_credentials() helper that maps AWS_API_KEY and AWS_SECRET_KEY to the standard AWS env vars for boto3 - Add download_s3_files() for direct S3 download with progress bar - Extract script now downloads from S3 when AWS_API_KEY is set, removing the need for a separate aws s3 sync step - Falls back to S3_DATA_DIR for pre-downloaded files - Updated README AWS setup section to use the new env vars Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop custom AWS_API_KEY/AWS_SECRET_KEY aliases in favour of the standard AWS environment variable names that boto3 and the AWS CLI already recognise natively. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Add `scripts/hyperliquid/refresh-mfa-session.sh` — helper script to obtain AWS STS session credentials for accounts with MFA enforcement, auto-detects MFA device ARN and updates `~/.aws/credentials` automatically - Update `README-hyperliquid-backfill.md` with MFA authentication section (section 4a) and expand all credential commands to show both without-MFA and with-MFA variants
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
s3://hyperliquid-archive/account_values/daily snapshotsextract-s3-vault-data.py): Parse LZ4-compressed CSV files, filter vault rows (is_vault=true), store in staging DuckDB. Resumable — skips already-processed datesbackfill-vault-data.py): Insert missing dates into maindaily-metrics.duckdb, recompute share prices. Only fills gaps, never overwrites API data. Rows tagged withdata_source='s3_backfill'data_sourcecolumn tovault_daily_pricestable for provenance trackingREADME-hyperliquid-backfill.md🤖 Generated with Claude Code