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 the exact hardcoded MONY detection record. |
|
Create the exact hardcoded MONY discovery lead. |
|
Get the selected MONY metadata database path. |
|
|
Create or refresh the MONY discovery lead and metadata row. |
|
Parse a boolean environment variable. |
|
Load an existing metadata database or create an empty one. |
|
Insert only MONY metadata without disturbing pipeline cursor or history. |
- parse_bool_env(name, *, default=False)
Parse a boolean environment variable.
- get_vault_database_path()
Get the selected MONY metadata database path.
- Returns
Configured metadata database path, or the shared default.
- Return type
- create_mony_detection()
Create the exact hardcoded MONY detection record.
- Returns
Discovery-compatible MONY FACT detection.
- Return type
- create_mony_lead()
Create the exact hardcoded MONY discovery lead.
- Returns
Zero-event lead for the FACT Diamond deployment.
- Return type
- 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
- update_mony_metadata(database, row, *, dry_run, output_path)
Insert only MONY metadata without disturbing pipeline cursor or history.
The shared
update_leads_and_rowshelper 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
database (eth_defi.vault.vaultdb.VaultDatabase) – Loaded shared vault metadata database.
row (dict) – Fresh MONY metadata scan row.
dry_run (bool) – Whether output writes are disabled.
output_path (pathlib.Path) – Metadata database destination.
- Returns
MONY vault specification inserted into the metadata database.
- Return type
- main()
Create or refresh the MONY discovery lead and metadata row.
- Return type
None