calculate_period_metrics
Documentation for eth_defi.research.vault_metrics.calculate_period_metrics function.
- calculate_period_metrics(period, gross_fee_data, net_fee_data, share_price_hourly, share_price_daily, tvl, now_)
Calculate metrics for one period.
- Parameters
period (Literal['1W', '1M', '3M', '6M', '1Y', 'lifetime']) – Period identifier (1W, 1M, 3M, 6M, 1Y, lifetime)
gross_fee_data (eth_defi.vault.fee.FeeData) – Fee data before fee mode adjustments
net_fee_data (eth_defi.vault.fee.FeeData) – Fee data after fee mode adjustments (for net return calculations)
share_price_hourly (pandas.core.series.Series) – Hourly share price series with DatetimeIndex
share_price_daily (pandas.core.series.Series) – Daily share price series with DatetimeIndex
tvl (pandas.core.series.Series) – Total value locked series with DatetimeIndex
now – The reference timestamp (usually the last timestamp in the data)
now_ (pandas._libs.tslibs.timestamps.Timestamp) –
- Returns
PeriodMetrics dataclass with calculated metrics
- Return type