tokenised_fund.backfill

Documentation for eth_defi.tokenised_fund.backfill Python module.

Coordinate tokenised-fund metadata and historical backfills.

Each protocol owns its implementation in eth_defi.tokenised_fund.<protocol>.backfill beside its vault adapter. This module provides the stable registry used by the generic operator script.

Module Attributes

PROTOCOL_BACKFILLS

Canonical protocol selectors accepted by the PROTOCOLS environment variable.

Functions

configure_optional_private_backfills(...)

Make the default all-protocol run tolerate unavailable private data.

main()

Run tokenised-fund backfills selected through environment variables.

parse_protocols(value)

Parse and validate a comma-separated protocol selection.

run_protocol_backfills(protocols)

Run selected protocol backfills sequentially.

PROTOCOL_BACKFILLS: dict[str, collections.abc.Callable[[], None]] = {'asseto': <function main>, 'centrifuge': <function main>, 'franklin': <function main>, 'kinexys': <function main>, 'libeara': <function main>, 'ondo': <function main>, 'securitize': <function main>, 'spiko': <function main>, 'superstate': <function main>, 'sygnum': <function main>, 'theo': <function main>, 'usyc': <function main>, 'wisdomtree': <function main>}

Canonical protocol selectors accepted by the PROTOCOLS environment variable.

parse_protocols(value)

Parse and validate a comma-separated protocol selection.

An unset or blank value selects every registered protocol in deterministic registry order. Duplicate selectors are removed without changing order.

Parameters

value (Optional[str]) – Raw PROTOCOLS environment value.

Returns

Validated protocol slugs.

Raises

ValueError – If an unknown protocol is requested.

Return type

tuple[str, …]

run_protocol_backfills(protocols)

Run selected protocol backfills sequentially.

Protocol backfills intentionally share the configured vault database, reader-state and Parquet paths, so deterministic sequential execution avoids concurrent file replacement.

Parameters

protocols (collections.abc.Iterable[str]) – Validated protocol slugs.

Returns

Completed protocol slugs.

Return type

tuple[str, …]

configure_optional_private_backfills(protocols_value, protocols)

Make the default all-protocol run tolerate unavailable private data.

WisdomTree metadata is public on-chain, but its official NAV history needs a private DataSpan API key. The implicit all-protocol workflow therefore registers its metadata and skips only the private price scan when neither the key nor an explicit price-scan choice is present. Explicit WisdomTree selections continue to fail closed without the credential.

Parameters
  • protocols_value (Optional[str]) – Raw PROTOCOLS environment value.

  • protocols (tuple[str, ...]) – Validated protocol selection.

Returns

None.

Return type

None

main()

Run tokenised-fund backfills selected through environment variables.

DRY_RUN defaults to true for the aggregate entry point. Operators must explicitly set DRY_RUN=false before any protocol may write. PROTOCOLS defaults to all registered integrations.

Returns

None.

Return type

None