Recurring price backfill API
The manual price-backfill entrypoint uses the same address-scoped historical
scan as the recurring all-chain scheduler. It is intended for already
registered products and does not change vault metadata or reader state.
Operator settings and targeted repair examples are documented in
scripts/erc-4626/README-vault-scripts.md.
Run targeted tokenised-fund price backfills through the recurring scanner.
The legacy protocol backfills may refresh metadata, lead discovery and prices
with protocol-specific implementations. This module is intentionally limited
to raw price history already owned by eth_defi.tokenised_fund.scan, so a
manual repair exercises the same address-scoped write path as the scheduler.
- class TokenisedFundPriceBackfillConfig
Bases:
objectOperator configuration for one recurring-path price backfill.
- vault_db_path: pathlib.Path
Shared reviewed vault metadata database.
- raw_price_path: pathlib.Path
Shared raw vault-price Parquet file.
- scanners: tuple[eth_defi.tokenised_fund.scan.TokenisedFundPriceScanSpec, ...]
Selected recurring price-feed definitions.
- __init__(vault_db_path, raw_price_path, scanners, vault_addresses, max_workers, hypersync_concurrency, dry_run)
- Parameters
vault_db_path (pathlib.Path) –
raw_price_path (pathlib.Path) –
scanners (tuple[eth_defi.tokenised_fund.scan.TokenisedFundPriceScanSpec, ...]) –
max_workers (int) –
hypersync_concurrency (int) –
dry_run (bool) –
- Return type
None
- parse_bool_env(name, default)
Read a strict boolean environment variable.
Empty values use
default. Explicit values must betrueorfalseso a typo cannot accidentally start a production rewrite.- Parameters
- Returns
Parsed boolean value.
- Raises
ValueError – If a configured value is not a boolean.
- Return type
- parse_path_env(name, default)
Read an optional path environment variable.
- Parameters
name (str) – Environment variable name.
default (pathlib.Path) – Path used when the variable is absent or empty.
- Returns
Expanded configured or default path.
- Return type
- parse_vault_addresses(value)
Parse an optional comma-separated lowercase token-address filter.
The recurring scanner stores and compares lowercase addresses, so this parser normalises operator input at the boundary.
- resolve_configured_chain_ids(target_specs, vault_addresses)
Return target chains that have a configured JSON-RPC URL.
Missing RPC URLs remain visible in the scan result diagnostics. Filtering them here prevents a targeted manual run from treating unrelated chains as operator-enabled.
- Parameters
target_specs (collections.abc.Iterable[eth_defi.vault.base.VaultSpec]) – Registered exact target specifications.
vault_addresses (Optional[frozenset[str]]) – Optional lowercase address filter.
- Returns
Chain ids with a configured RPC URL.
- Return type
- build_price_backfill_plan(config)
Build the exact target and continuation plan without modifying state.
The plan deliberately resolves starts through the same helper as the recurring scanner. It therefore exposes the exact address-scoped rewrite boundary that an execution would use.
- Parameters
config (eth_defi.tokenised_fund.price_backfill.TokenisedFundPriceBackfillConfig) – Manual backfill configuration.
- Returns
One plan row per selected registered product.
- Raises
RuntimeError – If the shared metadata database does not exist.
- Return type
- run_price_backfill(config)
Run selected recurring price feeds as a manual backfill.
Each selected feed retains its independent address-scoped Parquet rewrite semantics. The function makes no metadata or reader-state changes.
- Parameters
config (eth_defi.tokenised_fund.price_backfill.TokenisedFundPriceBackfillConfig) – Manual backfill configuration.
- Returns
Results keyed by dashboard name.
- Return type
dict[str, eth_defi.tokenised_fund.scan.TokenisedFundPriceScanResult]
- create_config_from_environment()
Build manual backfill configuration from environment variables.
DRY_RUNdefaults to true because an execution rewrites the shared raw Parquet file. Set it to false only after reviewing the printed plan.- Returns
Validated manual backfill configuration.
- Return type
eth_defi.tokenised_fund.price_backfill.TokenisedFundPriceBackfillConfig
- main()
Print or execute a tokenised-fund price backfill from environment.
- Returns
None.
- Return type
None