find_period

Documentation for eth_defi.vault_report.sections.find_period function.

find_period(period_results, period)

Find one period’s results in a vault’s period_results.

The top vaults export stores per-period metrics as a list of dicts, one per period, see eth_defi.research.vault_metrics.PeriodMetrics, rather than flat columns. The report reads the one-month TVL and the three-month maximum drawdown from here.

Parameters
  • period_results (Optional[list[dict]]) – period_results list of a top vaults JSON record, or None.

  • period (str) – Period name, e.g. 1M or 3M.

Returns

The period’s results, or an empty dict if missing.

Return type

dict