calculate_vault_record
Documentation for eth_defi.research.vault_metrics.calculate_vault_record function.
- calculate_vault_record(prices_df, vault_metadata_rows, month_ago, three_months_ago, vault_id=None)
Process a single vault metadata + prices to calculate its full data.
Exported to frontend, everything
- Parameters
prices_df (pandas.core.frame.DataFrame) – Price DataFrame for a single vault
vault_metadata_rows (dict[eth_defi.vault.base.VaultSpec, eth_defi.vault.vaultdb.VaultRow]) – Dictionary of vault metadata keyed by VaultSpec
month_ago (pandas._libs.tslibs.timestamps.Timestamp) – Timestamp for 1-month lookback
three_months_ago (pandas._libs.tslibs.timestamps.Timestamp) – Timestamp for 3-month lookback
vault_id (str | None) – Vault ID string. If not provided, extracted from prices_df[“id”].
- Returns
Series with calculated metrics
- Return type
pandas.core.series.Series