vault.export_post_processing

Documentation for eth_defi.vault.export_post_processing Python module.

Best-effort cleanup hooks for vault metadata exports.

The scanner stores raw discovery metadata for protocol-specific readers. The public JSON export may need a small amount of derived cleanup before metrics are calculated. Hooks in this module receive only the in-memory VaultDatabase used by that export.

Every hook is isolated. A broken offchain service or malformed optional record is logged and the export continues with the data it already has. This is deliberate: post-processing must not take down the long-running scanner.

Functions

run_vault_export_post_processors(vault_db[, ...])

Run export cleanup hooks without allowing one to stop the pipeline.

run_vault_export_post_processors(vault_db, processors=(<function clean_yearn_vault_metadata>, ))

Run export cleanup hooks without allowing one to stop the pipeline.

Hooks mutate only vault_db in memory. Each hook is timed and isolated; an exception is logged with a traceback and the next hook still runs. The returned IDs are useful to refresh stale sticky-export rows, but a failed hook simply contributes no IDs and leaves the original metadata intact.

Parameters
Returns

Union of vault IDs changed by successfully completed hooks.

Return type

set[str]