tokenised_fund.kinexys.backfill
Documentation for eth_defi.tokenised_fund.kinexys.backfill Python module.
Refresh Kinexys FACT products in the shared vault metadata database.
This migration writes the exact Ethereum discovery leads and current metadata rows for JLTXX and MONY. It intentionally does not rewrite the raw or cleaned price Parquet files, and it does not remove or modify any historical reader state.
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 rows 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 metadata migration from altering those
datasets.
Module Attributes
Reviewed Kinexys FACT deployments refreshed by this metadata migration. |
Functions
Create the exact hardcoded JLTXX detection record. |
|
Create the exact hardcoded JLTXX discovery lead. |
|
Create the exact hardcoded MONY detection record. |
|
Create the exact hardcoded MONY discovery lead. |
|
Get the selected Kinexys metadata database path. |
|
|
Create or refresh the JLTXX and MONY discovery leads and metadata rows. |
|
Parse a boolean environment variable. |
|
Load an existing metadata database or create an empty one. |
|
Upsert reviewed JLTXX and MONY rows without changing pipeline state. |
|
Insert only MONY metadata without disturbing pipeline cursor or history. |
- KINEXYS_PRODUCTS = (('0x09864f52b035ae22ee739dfa5c748fa080d07bd8', 25042223, datetime.datetime(2026, 5, 7, 9, 20, 11)), ('0x6a7c6aa2b8b8a6a891de552bdeffa87c3f53bd46', 23890166, datetime.datetime(2025, 11, 27, 12, 52, 11)))
Reviewed Kinexys FACT deployments refreshed by this metadata migration.
- parse_bool_env(name, *, default=False)
Parse a boolean environment variable.
- get_vault_database_path()
Get the selected Kinexys 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_jltxx_detection()
Create the exact hardcoded JLTXX detection record.
- Returns
Discovery-compatible JLTXX 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
- create_jltxx_lead()
Create the exact hardcoded JLTXX 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
- update_kinexys_metadata(database, rows, *, dry_run, output_path)
Upsert reviewed JLTXX and MONY rows without changing pipeline state.
- Parameters
database (eth_defi.vault.vaultdb.VaultDatabase) – Loaded shared vault metadata database.
rows (dict[eth_defi.vault.base.VaultSpec, dict]) – Fresh scan rows keyed by the exact reviewed Kinexys specifications.
dry_run (bool) – Whether output writes are disabled.
output_path (pathlib.Path) – Metadata database destination.
- Returns
Kinexys vault specifications selected for the migration.
- Raises
ValueError – If a caller supplies a row outside the reviewed JLTXX and MONY set.
- Return type
- main()
Create or refresh the JLTXX and MONY discovery leads and metadata rows.
- Return type
None