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_spiko_detection()

Create the exact hardcoded USTBL discovery record.

main()

Run the address-scoped USTBL migration.

parse_bool_env(name, *[, default])

Read an optional boolean environment variable.

parse_path_env(name, default)

Read a path override without changing production defaults.

read_reader_states(path)

Load trusted persisted reader state when available.

resolve_frequency()

Require daily sampling for the daily reconciled USTBL NAV.

resolve_start_block()

Select the first block with the official USTBL NAV oracle.

write_reader_states(path, states)

Atomically write merged reader state.

parse_bool_env(name, *, default=False)

Read an optional boolean environment variable.

Parameters
  • name (str) – Environment variable name.

  • default (bool) – Value when the variable is absent.

Returns

Parsed boolean value.

Return type

bool

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

pathlib.Path

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

int

create_spiko_detection()

Create the exact hardcoded USTBL discovery record.

Returns

Ethereum USTBL classification record.

Return type

eth_defi.erc_4626.core.ERC4262VaultDetection

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

dict[eth_defi.vault.base.VaultSpec, dict]

write_reader_states(path, states)

Atomically write merged reader state.

Parameters
Return type

None

main()

Run the address-scoped USTBL migration.

Return type

None