partition_due_vault_ids
Documentation for eth_defi.research.metrics_freshness.partition_due_vault_ids function.
- partition_due_vault_ids(seen_ids, state, current_tvl_by_id, peak_tvl_by_id, family_by_id, export_threshold_by_id, now, patchable_ids=None)
Split vaults into due (recalculate) and skipped (keep previous record).
See the module docstring for the due rules. The optional
patchable_idsprecondition is used by the crypto bundle, which has no sticky record replay: a vault may only be skipped when a validated previous export record exists to patch into the output. The stablecoin bundle passesNonebecause its sticky export state replays skipped vaults automatically.- Parameters
seen_ids (set[str]) – Vault ids present in the current price data.
state (dict) – Loaded freshness state mapping.
current_tvl_by_id (dict[str, float | None]) – Current TVL per vault from
compute_vault_tvl_observations().peak_tvl_by_id (dict[str, float | None]) – Peak TVL per vault from
compute_vault_tvl_observations().family_by_id (dict[str, str]) –
DenominationFamilyvalue per vault.export_threshold_by_id (dict[str, float]) – Per-vault export threshold (with protocol overrides) in the vault’s denomination unit.
now (datetime.datetime) – Current naive UTC datetime.
patchable_ids (Optional[set[str]]) – Optional set of vault ids with a validated previous record to patch.
- Returns
(due_ids, skipped_ids)partitioningseen_ids.- Return type