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

KINEXYS_PRODUCTS

Reviewed Kinexys FACT deployments refreshed by this metadata migration.

Functions

create_jltxx_detection()

Create the exact hardcoded JLTXX detection record.

create_jltxx_lead()

Create the exact hardcoded JLTXX discovery lead.

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 Kinexys metadata database path.

main()

Create or refresh the JLTXX and MONY discovery leads and metadata rows.

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_kinexys_metadata(database, rows, *, ...)

Upsert reviewed JLTXX and MONY rows without changing pipeline state.

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

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.

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 Kinexys 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_jltxx_detection()

Create the exact hardcoded JLTXX detection record.

Returns

Discovery-compatible JLTXX 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

create_jltxx_lead()

Create the exact hardcoded JLTXX 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

update_kinexys_metadata(database, rows, *, dry_run, output_path)

Upsert reviewed JLTXX and MONY rows without changing pipeline state.

Parameters
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

tuple[eth_defi.vault.base.VaultSpec, …]

main()

Create or refresh the JLTXX and MONY discovery leads and metadata rows.

Return type

None