tokenised_fund.centrifuge.backfill

Documentation for eth_defi.tokenised_fund.centrifuge.backfill Python module.

Register the reviewed JTRSY Tranche token without rewriting price history.

The direct JTRSY Tranche token has no authoritative NAV/share-price accessor. This migration therefore only upserts its lead and scan metadata; it intentionally does not alter the shared raw/cleaned price Parquet files or reader-state pickle. Existing unrelated vault records remain untouched.

Run with:

source .local-test.env && PROTOCOLS=centrifuge poetry run python scripts/backfill-tokenised-funds.py

Set DRY_RUN=true to inspect the planned write. Set VAULT_DB_PATH to use an alternative metadata database, and END_BLOCK to choose the metadata block instead of the current Ethereum head.

Functions

main()

Upsert the JTRSY lead and metadata row only.

parse_bool_env(name, *[, default])

Parse a conventional boolean environment setting.

read_vault_database(path)

Load an existing vault database or initialise an empty one.

upsert_jtrsy_metadata_preserving_discovery_cursor(...)

Upsert JTRSY metadata without changing chain-wide discovery state.

parse_bool_env(name, *, default=False)

Parse a conventional boolean environment setting.

Parameters
  • name (str) – Environment variable name.

  • default (bool) – Value to return if the variable is absent.

Returns

Parsed boolean value.

Return type

bool

read_vault_database(path)

Load an existing vault database or initialise an empty one.

Parameters

path (pathlib.Path) – Vault metadata pickle location.

Returns

Existing or empty database.

Return type

eth_defi.vault.vaultdb.VaultDatabase

upsert_jtrsy_metadata_preserving_discovery_cursor(vault_db, lead, row)

Upsert JTRSY metadata without changing chain-wide discovery state.

A targeted migration must not advance or initialise the Ethereum discovery cursor because unrelated contracts may still need to be discovered below the metadata block used for this repair.

Parameters
Returns

None.

Return type

None

main()

Upsert the JTRSY lead and metadata row only.

This deliberately avoids a historical price scan. A price rewrite with no authoritative NAV would add null-valued history and risk replacing useful unrelated Parquet state.

Return type

None