rank_vaults

Documentation for eth_defi.vault_report.sections.rank_vaults function.

rank_vaults(df, column='one_month_cagr_best')

Sort vaults by a metric, best first.

The single ranking used by every table and chart selector, so a vault’s position is the same wherever it appears.

The export caps annualised returns at 10,000%, CAPPED_ANNUALISED_RETURN, so several perp DEX or newly launched vaults can share the same top value. Ties are broken with the absolute, non-annualised return of the same period (export three_months_returns or one_month_returns), which is not capped: three months for metrics whose name starts with three_months, which includes the three-month Sharpe ranking, one month otherwise. Vaults without the metric sort last instead of being dropped, so callers decide whether to filter them.

Parameters
  • df (pandas.DataFrame) – Vault metrics with column and its tie-breaker column.

  • column (str) – Ranking metric, by default the annualised one-month return.

Returns

Sorted vault metrics, the same rows.

Return type

pandas.DataFrame