Tokenised fund price scheduling

The recurring price-feed registry integrates reviewed tokenised-fund adapters with the all-chain vault scanner. It selects already registered products by their persisted protocol feature, writes address-scoped daily samples and keeps each protocol’s scheduler result separate. Every product has an independent continuation and rewrite boundary so a missing-history bootstrap cannot remove another product’s rows.

Stable issuer NAVs still emit one approximate daily sample. This keeps the dashboard freshness timestamp current even when the value does not change.

Operator settings and bootstrap behaviour are documented in scripts/erc-4626/README-vault-scripts.md.

Recurring price scans for reviewed tokenised-fund products.

The protocol backfill modules remain the explicit bootstrap and repair path. This module is deliberately narrower: it refreshes only products that are already present in the shared vault metadata database and writes only their address-scoped raw-price rows.

class TokenisedFundPriceScanSpec

Bases: object

One independently scheduled tokenised-fund price feed.

The feature marker is the authoritative link between the scheduler and the persisted vault metadata. Product-specific predicates exclude known supply-only products such as Libeara ULTRA and non-fund Midas products.

selector: str

Stable configuration selector.

dashboard_name: str

Human-readable independent scheduler row.

feature: eth_defi.erc_4626.core.ERC4626Feature

Persisted vault feature identifying candidate products.

accepts: collections.abc.Callable[[eth_defi.vault.base.VaultSpec], bool]

Optional reviewed-product filter within the feature family.

prerequisite_env: Optional[str]

Optional credential required by the source adapter.

refetch_tail: bool

Replay a bounded tail because issuer NAV data may be revised.

prerequisite_error()

Return a human-readable unmet prerequisite, when any.

Returns

Missing environment-variable error, or None when ready.

Return type

Optional[str]

__init__(selector, dashboard_name, feature, accepts=<function TokenisedFundPriceScanSpec.<lambda>>, prerequisite_env=None, refetch_tail=False)
Parameters
Return type

None

class TokenisedFundPriceScanContext

Bases: object

Explicit shared paths and resource limits for one scheduled scan.

vault_db_path: pathlib.Path

Shared reviewed vault metadata database.

raw_price_path: pathlib.Path

Shared raw vault-price Parquet file.

max_workers: int

Maximum threaded historical-read workers.

enabled_chain_ids: frozenset[int]

Chains allowed by the operator’s chain configuration.

vault_addresses: Optional[frozenset[str]]

Optional lowercase product-address filter for a targeted backfill.

hypersync_concurrency: Optional[int]

Shared Hypersync stream concurrency limit.

rpc_request_stats: Optional[eth_defi.provider.rpcdb.RPCRequestStats]

Optional shared physical JSON-RPC request counter.

asseto_registry_cache_path: Optional[pathlib.Path]

Optional persistent Asseto registry cache override for isolated runs.

__init__(vault_db_path, raw_price_path, max_workers, enabled_chain_ids, vault_addresses=None, hypersync_concurrency=None, rpc_request_stats=None, asseto_registry_cache_path=None)
Parameters
Return type

None

class TokenisedFundPriceScanResult

Bases: object

Summary of one tokenised-fund scheduled price refresh.

vault_count: int

Number of exact registered products considered.

price_rows: int

Number of raw daily sample rows written.

latest_data_timestamp: Optional[str]

Latest non-null sampled NAV timestamp.

start_block: Optional[int]

Earliest block scanned across target products.

end_block: Optional[int]

Latest block scanned across target products.

diagnostics: Optional[str]

Non-fatal skipped-target diagnostics.

__init__(vault_count, price_rows, latest_data_timestamp, start_block, end_block, diagnostics=None)
Parameters
Return type

None

TOKENISED_FUND_PRICE_CAPABILITIES: dict[str, str] = {'asseto': 'scheduled', 'centrifuge': 'supply only; no reviewed NAV/share source', 'fdit': 'supply only; no reviewed NAV/share source', 'franklin': 'scheduled', 'kaio': 'supply only; no reviewed NAV/share source', 'kinexys': 'static adapter estimate, not a refreshable feed', 'libeara': 'scheduled for CUMIU and BELIF only', 'midas': 'scheduled for tokenised-fund products only', 'ondo': 'scheduled', 'openeden': 'scheduled', 'securitize': 'scheduled for products with reviewed NAV', 'spiko': 'scheduled', 'superstate': 'scheduled', 'sygnum': 'scheduled', 'theo': 'supply only; no reviewed scalar NAV source', 'usyc': 'scheduled', 'wisdomtree': 'scheduled when DataSpan credentials are configured'}

Every aggregate backfill selector has either a scheduled source or an explicit reason why it is not a recurring price feed.

select_tokenised_fund_price_scanners(selection)

Resolve an optional comma-separated protocol selection.

Parameters

selection (Optional[str]) – TOKENISED_FUND_PROTOCOLS value, or None for every scanner.

Returns

Selected scanner specs in stable dashboard order.

Raises

ValueError – If a selector is not price-capable.

Return type

tuple[eth_defi.tokenised_fund.scan.TokenisedFundPriceScanSpec, …]

resolve_target_start_blocks(spec, raw_price_path, targets)

Choose one independent continuation point per exact product.

The latest non-null raw price is the continuation source for these stateless daily reads. Null rows after that point do not hide a price gap. A missing product starts at its reviewed deployment or discovery block. Each product is scanned and rewritten separately, so bootstrapping one product cannot delete another product’s newer history.

Parameters
Returns

Exact target-to-start-block mapping.

Return type

dict[eth_defi.vault.base.VaultSpec, int]

load_tokenised_fund_target_specs(vault_db_path, scanners)

Load exact products owned by ready dedicated scanners.

Disabled, unselected and product-filtered vaults remain under generic scanner ownership. A missing metadata database safely owns no products.

Parameters
Returns

Exact chain and address pairs reserved for dedicated daily scans.

Return type

set[eth_defi.vault.base.VaultSpec]

load_tokenised_fund_last_timestamps(raw_price_path, vault_db_path)

Load dashboard freshness per protocol from its exact target addresses.

Parameters
  • raw_price_path (pathlib.Path) – Shared raw price Parquet path.

  • vault_db_path (pathlib.Path) – Shared vault metadata path containing persisted feature markers.

Returns

Mapping of dashboard names to latest valid NAV timestamp.

Return type

dict[str, str]

run_tokenised_fund_price_scan(spec, context)

Refresh one reviewed protocol’s raw price rows.

When no prior raw row exists, start from the reviewed vault deployment block. This intentionally favours complete daily history over a precise initial source boundary; the relevant adapter still rejects calls before its oracle or issuer data is available.

The scanner uses the same archive-state adapters as the normal vault price pipeline and samples at approximately one-day intervals. It does not claim to preserve every source update or its original publication timestamp.

Parameters
Returns

Aggregate scan result across every configured target chain.

Raises

RuntimeError – If the metadata database or a selected product adapter is invalid.

Return type

eth_defi.tokenised_fund.scan.TokenisedFundPriceScanResult