recover_leader_shares

Documentation for eth_defi.hyperliquid.leader_share_recovery.recover_leader_shares function.

recover_leader_shares(target, sources, backup_dir, *, parquet_sources=None, dry_run=True)

Restore missing policy values from backups and retained migration evidence.

Scanner values precede raw Parquet values; source order resolves conflicting shares. Explicit caps are restored only when their accompanying share agrees with the retained share, or the cap has no share input. Existing non-null values win. Genuine responses and explicit unknowns retain export precedence. The migration never changes economics, permission flags or original clocks. Apply takes a verified backup before its transaction; dry run is read-only.

Parameters
  • target (pathlib.Path) – Stopped daily or HF scanner database; use a copy for rehearsals.

  • sources (list[pathlib.Path]) – Immutable scanner backups in preference order.

  • backup_dir (pathlib.Path) – Directory for automatic verified pre-mutation backups.

  • parquet_sources (Optional[list[pathlib.Path]]) – Original raw price exports, after scanner sources.

  • dry_run (bool) – Report prospective changes without persistent writes.

Returns

Source hashes, restored-value counts, conflicts and backup receipt.

Return type

dict