tokenised_fund.kinexys.backfill

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

Register the MONY FACT Diamond in the shared vault metadata database.

MONY has no public, verified NAV or share-price source. This migration therefore only writes its exact Ethereum discovery lead and current metadata row. It intentionally does not rewrite the raw or cleaned price Parquet files, and it does not remove or modify any historical reader state: supply-only rows without a price are not a usable fund-price history.

Usage:

source .local-test.env
export JSON_RPC_ETHEREUM="https://your-archive-ethereum-rpc"
PROTOCOLS=kinexys poetry run python scripts/backfill-tokenised-funds.py

Set DRY_RUN=true to validate the planned MONY row without writing. Optional END_BLOCK selects the metadata snapshot block and VAULT_DB_PATH selects the metadata database. No raw-price, cleaned-price, or reader-state path is accepted by design, preventing this supply-only migration from altering those datasets.

Functions

create_mony_detection()

Create the exact hardcoded MONY detection record.

create_mony_lead()

Create the exact hardcoded MONY discovery lead.

get_vault_database_path()

Get the selected MONY metadata database path.

main()

Create or refresh the MONY discovery lead and metadata row.

parse_bool_env(name, *[, default])

Parse a boolean environment variable.

read_vault_database(path)

Load an existing metadata database or create an empty one.

update_mony_metadata(database, row, *, ...)

Insert only MONY metadata without disturbing pipeline cursor or history.

parse_bool_env(name, *, default=False)

Parse a boolean environment variable.

Parameters
  • name (str) – Environment variable name.

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

Returns

Parsed boolean value.

Return type

bool

get_vault_database_path()

Get the selected MONY metadata database path.

Returns

Configured metadata database path, or the shared default.

Return type

pathlib.Path

create_mony_detection()

Create the exact hardcoded MONY detection record.

Returns

Discovery-compatible MONY FACT detection.

Return type

eth_defi.erc_4626.core.ERC4262VaultDetection

create_mony_lead()

Create the exact hardcoded MONY discovery lead.

Returns

Zero-event lead for the FACT Diamond deployment.

Return type

eth_defi.erc_4626.discovery_base.PotentialVaultMatch

read_vault_database(path)

Load an existing metadata database or create an empty one.

Parameters

path (pathlib.Path) – Metadata database input path.

Returns

Existing database, or an empty database when it has not been created.

Return type

eth_defi.vault.vaultdb.VaultDatabase

update_mony_metadata(database, row, *, dry_run, output_path)

Insert only MONY metadata without disturbing pipeline cursor or history.

The shared update_leads_and_rows helper advances the Ethereum discovery cursor. A one-vault repair must not do that, because it has not scanned other Ethereum contracts. Directly updating this exact specification keeps every unrelated row, lead, reader-state entry and Parquet row intact.

Parameters
Returns

MONY vault specification inserted into the metadata database.

Return type

eth_defi.vault.base.VaultSpec

main()

Create or refresh the MONY discovery lead and metadata row.

Return type

None