align_share_price_curve_to_anchor

Documentation for eth_defi.hyperliquid.combined_analysis.align_share_price_curve_to_anchor function.

align_share_price_curve_to_anchor(prices_df, anchor_timestamp, anchor_share_price)

Resume a reconstructed share-price curve from one persisted price.

A positive persisted price is aligned at its exact timestamp, or interpolated in log-price space between bracketing observations for the high-frequency scanner. The resulting constant factor is applied with rescale_share_price_rows(), preserving NAV and supply.

A persisted zero may be a valid observation for a Hyperliquid vault whose NAV was completely wiped out while synthetic supply remained. The scanner cannot classify the zero as durable or transient at resume time, but zero cannot be used as a scale factor in either case. The reconstructed curve is therefore returned unchanged. Any later recapitalisation epoch is selected and normalised by the wrangle pipeline. Negative and non-finite persisted prices indicate invalid stored data and raise ValueError.

Parameters
  • prices_df (pandas.DataFrame) – Chronologically sorted DataFrame with a DatetimeIndex and share_price, total_supply and total_assets columns.

  • anchor_timestamp (Union[datetime.datetime, pandas.Timestamp]) – Timestamp of the already persisted price.

  • anchor_share_price (float) – Finite non-negative persisted share price. Zero denotes a lifecycle boundary that cannot anchor the reconstructed scale.

Returns

Rescaled or unchanged DataFrame, or None when a positive anchor lies outside the curve or cannot be interpolated.

Return type

Optional[pandas.DataFrame]