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
Returns

Copy of prices_df with vault_settlement_at populated.

Return type

pandas.DataFrame