run_daily_scan
Documentation for eth_defi.hyperliquid.daily_metrics.run_daily_scan function.
- run_daily_scan(session, db_path=PosixPath('/home/runner/.tradingstrategy/vaults/hyperliquid-vaults.duckdb'), min_tvl=5000, max_vaults=20000, max_workers=16, cutoff_date=None, timeout=30.0, vault_addresses=None, flow_backfill_days=7, full_scan=False)
Run the daily Hyperliquid vault metrics scan.
Bulk-fetches all vaults from stats-data API
Filters by TVL and vault limit (or by explicit address list)
Fetches per-vault details and computes share prices
Fetches deposit/withdrawal events for flow metrics
Stores everything in DuckDB
- Parameters
session (eth_defi.hyperliquid.session.HyperliquidSession) – HTTP session with rate limiting. Use
create_hyperliquid_session().db_path (pathlib.Path) – Path to the DuckDB database file.
min_tvl (float) – Minimum TVL in USD to include a vault. Ignored when
vault_addressesis provided.max_vaults (int) – Maximum number of vaults to process (sorted by TVL descending). Ignored when
vault_addressesis provided.max_workers (int) – Number of parallel workers for fetching vault details.
cutoff_date (Optional[datetime.date]) – If provided, only store price data up to this date. Used for incremental scanning / testing.
timeout (float) – HTTP request timeout.
vault_addresses (Optional[list[str]]) – If provided, only scan these specific vault addresses. Overrides
min_tvlandmax_vaultsfilters.flow_backfill_days (int) – Number of complete days to backfill deposit/withdrawal flow data. Only complete days are fetched (up to yesterday). Set to
0to disable flow fetching. Use a large value (e.g.365) for initial deep backfill.full_scan (bool) – When
True, bypass themin_tvlfilter and process all vaults that exist in the database and are still present in the bulk API listing, regardless of their current TVL. This is intended to be run periodically (e.g. once a week) to refresh data for vaults that have dropped below the daily TVL threshold but still have historical data worth keeping current. Themax_vaultslimit still applies to cap total work. Ignored whenvault_addressesis provided.
- Returns
The metrics database instance.
- Return type
eth_defi.hyperliquid.daily_metrics.HyperliquidDailyMetricsDatabase