annotate_prices_with_vault_settlements
Documentation for eth_defi.vault.settlement_data.annotate_prices_with_vault_settlements function.
- annotate_prices_with_vault_settlements(prices_df, settlements_df)
Annotate cleaned price rows with settlement timestamps.
For each
(chain, address)group, a price row receives the latest settlement timestamp in(previous_price_timestamp, current_timestamp]. The first row receives the latest settlement timestamp up to its timestamp.The production cleaning pipeline calls this after row-level cleaning, so raw price parquet rows remain settlement-free.
- Parameters
prices_df (pandas.DataFrame) – Cleaned vault prices DataFrame. Must contain
chain,addressandtimestampcolumns, or use a datetime index for timestamps.settlements_df (pandas.DataFrame) – Settlement DataFrame from
VaultSettlementDatabase.
- Returns
Copy of
prices_dfwithvault_settlement_atpopulated.- Return type