merge_into_vault_database
Documentation for eth_defi.lighter.vault_data_export.merge_into_vault_database function.
- merge_into_vault_database(db, vault_db_path)
Merge Lighter pool metadata into an existing VaultDatabase pickle.
Reads the existing pickle, upserts Lighter VaultRow entries (keyed by VaultSpec), and writes back. Idempotent: running twice produces the same result.
If the pickle file does not exist, creates a new VaultDatabase.
- Parameters
db (eth_defi.lighter.daily_metrics.LighterDailyMetricsDatabase) – The Lighter daily metrics database.
vault_db_path (pathlib.Path) – Path to the VaultDatabase pickle file.
- Returns
The updated VaultDatabase.
- Return type