PeriodMetrics

Documentation for eth_defi.research.vault_metrics.PeriodMetrics Python class.

class PeriodMetrics

Bases: object

Tearsheet metrics for one period.

Attributes summary

period

error_reason

Error reason if metrics could not be calculated, None if successful

period_start_at

When was start share price sampled

period_end_at

When was end share price sampled

share_price_start

Share price at beginning

share_price_end

Share price at end

raw_samples

Number of raw datapoints used

samples_start_at

samples_end_at

daily_samples

Number of daily datapoitns used

returns_gross

How much absolute returns we had

returns_net

cagr_gross

Compounding annual returns

cagr_net

volatility

Annualised volatility, calculated based on daily returns

sharpe

Sharpe ratio

max_drawdown

Period maximum drawdown

tvl_start

TVL at the start of the period

tvl_end

TVL at the end of the period

tvl_low

Minimum TVL in the period

tvl_high

Maximum TVL in the period

ranking_overall

Rank among all vaults (1 = best), based on CAGR

ranking_chain

Rank among vaults on the same chain (1 = best), based on CAGR

ranking_protocol

Rank among vaults in the same protocol (1 = best), based on CAGR

Methods summary

__init__(period[, error_reason, ...])

error_reason: str | None

Error reason if metrics could not be calculated, None if successful

period_start_at: pandas._libs.tslibs.timestamps.Timestamp | None

When was start share price sampled

period_end_at: pandas._libs.tslibs.timestamps.Timestamp | None

When was end share price sampled

share_price_start: float | None

Share price at beginning

share_price_end: float | None

Share price at end

raw_samples: int

Number of raw datapoints used

daily_samples: int

Number of daily datapoitns used

returns_gross: float | None

How much absolute returns we had

cagr_gross: float | None

Compounding annual returns

volatility: float | None

Annualised volatility, calculated based on daily returns

sharpe: float | None

Sharpe ratio

max_drawdown: float | None

Period maximum drawdown

tvl_start: float | None

TVL at the start of the period

tvl_end: float | None

TVL at the end of the period

tvl_low: float | None

Minimum TVL in the period

tvl_high: float | None

Maximum TVL in the period

ranking_overall: int | None

Rank among all vaults (1 = best), based on CAGR

ranking_chain: int | None

Rank among vaults on the same chain (1 = best), based on CAGR

ranking_protocol: int | None

Rank among vaults in the same protocol (1 = best), based on CAGR

__init__(period, error_reason=None, period_start_at=None, period_end_at=None, share_price_start=None, share_price_end=None, raw_samples=0, samples_start_at=None, samples_end_at=None, daily_samples=0, returns_gross=None, returns_net=None, cagr_gross=None, cagr_net=None, volatility=None, sharpe=None, max_drawdown=None, tvl_start=None, tvl_end=None, tvl_low=None, tvl_high=None, ranking_overall=None, ranking_chain=None, ranking_protocol=None)
Parameters
  • period (Literal['1W', '1M', '3M', '6M', '1Y', 'lifetime']) –

  • error_reason (str | None) –

  • period_start_at (pandas._libs.tslibs.timestamps.Timestamp | None) –

  • period_end_at (pandas._libs.tslibs.timestamps.Timestamp | None) –

  • share_price_start (float | None) –

  • share_price_end (float | None) –

  • raw_samples (int) –

  • samples_start_at (pandas._libs.tslibs.timestamps.Timestamp | None) –

  • samples_end_at (pandas._libs.tslibs.timestamps.Timestamp | None) –

  • daily_samples (int) –

  • returns_gross (float | None) –

  • returns_net (float | None) –

  • cagr_gross (float | None) –

  • cagr_net (float | None) –

  • volatility (float | None) –

  • sharpe (float | None) –

  • max_drawdown (float | None) –

  • tvl_start (float | None) –

  • tvl_end (float | None) –

  • tvl_low (float | None) –

  • tvl_high (float | None) –

  • ranking_overall (int | None) –

  • ranking_chain (int | None) –

  • ranking_protocol (int | None) –

Return type

None