materialise_daily_crypto_prices

Documentation for eth_defi.research.wrangle_vault_prices.materialise_daily_crypto_prices function.

materialise_daily_crypto_prices(prices_df)

Select valid daily closing observations and each vault’s first price.

The first valid observation is retained alongside the first day’s final valid observation so lifetime returns and young-vault charts include that day’s movement. Later days retain one valid closing observation. Missing timestamps, negative prices and non-finite prices are excluded from this derivative; the original hourly observations remain intact. Same-timestamp prices use the final block instead of creating an ambiguous duplicate. The exported parquet preserves real timestamps; the crypto bundle regularises these to calendar days when it calculates metrics: stablecoin vaults with eth_defi.research.vault_metrics.calculate_sparse_daily_returns_for_all_vaults(), and ETH/BTC vaults one vault at a time in eth_defi.vault.crypto_vaults.

Parameters

prices_df (pandas.DataFrame) – Cleaned selected-family price rows with naive UTC timestamp/index, string id and numeric or nullable share_price columns.

Returns

Chronologically sorted, observation-preserving daily price rows using the existing cleaned-price schema.

Return type

pandas.DataFrame