tokenised_fund.spiko.backfill
Documentation for eth_defi.tokenised_fund.spiko.backfill Python module.
Backfill only Ethereum Spiko USTBL metadata and NAV history.
This generated migration is address-scoped: it merges the USTBL discovery row, preserves the existing Ethereum discovery watermark and retains every unrelated reader-state, raw-Parquet and cleaned-Parquet entry. The supported daily NAV history starts with Spiko’s official Oracle deployment.
Run with source .local-test.env && PROTOCOLS=spiko poetry run python scripts/backfill-tokenised-funds.py.
Set DRY_RUN=true to inspect the plan first. START_BLOCK, END_BLOCK,
MAX_WORKERS, VAULT_DB_PATH, UNCLEANED_PRICE_DATABASE,
CLEANED_PRICE_DATABASE and READER_STATE_DATABASE are optional overrides.
Functions
Create the exact hardcoded USTBL discovery record. |
|
|
Run the address-scoped USTBL migration. |
|
Read an optional boolean environment variable. |
|
Read a path override without changing production defaults. |
|
Load trusted persisted reader state when available. |
Require daily sampling for the daily reconciled USTBL NAV. |
|
Select the first block with the official USTBL NAV oracle. |
|
|
Atomically write merged reader state. |
- parse_bool_env(name, *, default=False)
Read an optional boolean environment variable.
- parse_path_env(name, default)
Read a path override without changing production defaults.
- Parameters
name (str) – Environment variable name.
default (pathlib.Path) – Default scanner path.
- Returns
Expanded configured path.
- Return type
- resolve_frequency()
Require daily sampling for the daily reconciled USTBL NAV.
- Returns
Daily scanner frequency.
- Raises
ValueError – If a different frequency was requested.
- Return type
Literal[‘1h’, ‘1d’]
- resolve_start_block()
Select the first block with the official USTBL NAV oracle.
- Returns
Explicit override or the Oracle deployment block.
- Return type
- create_spiko_detection()
Create the exact hardcoded USTBL discovery record.
- Returns
Ethereum USTBL classification record.
- Return type
- read_reader_states(path)
Load trusted persisted reader state when available.
- Parameters
path (pathlib.Path) – Shared reader-state pickle file.
- Returns
Existing reader states, or an empty mapping.
- Return type
- write_reader_states(path, states)
Atomically write merged reader state.
- Parameters
path (pathlib.Path) – Shared reader-state pickle file.
states (dict[eth_defi.vault.base.VaultSpec, dict]) – Merged state mapping.
- Return type
None
- main()
Run the address-scoped USTBL migration.
- Return type
None