write_daily_crypto_prices_sidecar
Documentation for eth_defi.research.wrangle_vault_prices.write_daily_crypto_prices_sidecar function.
- write_daily_crypto_prices_sidecar(prices_df, destination_path, logger=<built-in function print>)
Write an atomic daily sidecar from an already-cleaned price frame.
The scheduled scanner otherwise writes the hourly stablecoin Parquet and immediately reads all of its rows again when building the private crypto bundle. Materialising this small observation-preserving sidecar while the cleaned frame is already resident removes that second wide read. The derivative is written to a temporary sibling and verified before replace, so an interrupted scan cannot replace a valid previous sidecar with a partial file. A metadata version prevents readers from reusing a sidecar produced under the previous daily observation policy.
- Parameters
prices_df (pandas.DataFrame) – Settlement-annotated cleaned hourly rows with a timestamp index.
destination_path (pathlib.Path) – Atomic daily Parquet destination.
- Returns
Number of daily rows written.
- Return type
Baseline (2026-09-22 production run): crypto construction reread 10,116,623 hourly stablecoin rows before daily materialisation. In the 2026-09-22 production-shaped run, the sidecar contained 1,945,631 rows and its atomic write took 5.91 seconds. The old path reread and materialised 10,116,623 hourly rows; that wide reread was not isolated in the source log, so no standalone speed-up or sidecar RSS is claimed. The complete cleaner’s peak process RSS was 20.4 GiB.