BestSection

Documentation for eth_defi.vault_report.post.BestSection Python class.

class BestSection

Bases: object

One ranked vault group of the post: its table, performance chart and section.

The single definition of a best-performing section. The tables, the chart selection, the chart panel, the criteria notes and the post section are all derived from it, see BEST_SECTIONS. Keeping them in one place means a new vault group, or a changed ranking metric, cannot leave the table, the chart and the investability check candidates (eth_defi.vault_report.report.collect_top_lists()) out of step.

Tables rank by the one-month return like the website’s live ranking, while the charts rank by the steadier three-month return, see chart_metric, so the two lists of a section may differ.

Attributes summary

key

Section key, e.g.

group

Vault group, see eth_defi.vault_report.sections.classify_vault()

heading

Section heading

heading_id

Heading anchor id

subject

The ranked vaults in chart titles and alt texts, e.g.

benchmark

What the chart compares the vaults against

metric

Table ranking column

measure

Chart lines: equity curves, or the rolling sharpe ratio ranked by metric

ranked_by

How the chart subtitle describes the ranking, e.g.

link

Live page on the website, without https://, for the chart footer

intro

Introduction paragraph HTML, with links to the website

chart_key

Key of the performance chart in PostContext.charts.

chart_metric

Column that picks and ranks the chart vaults: the steadier three-month return, or the Sharpe ratio.

template

The post section of this group.

Methods summary

__init__(key, group, heading, heading_id, ...)

key: str

Section key, e.g. lending: the table and criteria notes key

group: str

Vault group, see eth_defi.vault_report.sections.classify_vault()

heading: str

Section heading

heading_id: str

Heading anchor id

subject: str

The ranked vaults in chart titles and alt texts, e.g. the best-performing lending vaults

benchmark: str

What the chart compares the vaults against

metric: str

Table ranking column

measure: Literal['equity', 'sharpe']

Chart lines: equity curves, or the rolling sharpe ratio ranked by metric

ranked_by: str

How the chart subtitle describes the ranking, e.g. funds by 3M return

link: str

Live page on the website, without https://, for the chart footer

intro: str

Introduction paragraph HTML, with links to the website

property chart_key: str

Key of the performance chart in PostContext.charts.

property chart_metric: str

Column that picks and ranks the chart vaults: the steadier three-month return, or the Sharpe ratio.

property template: eth_defi.vault_report.post.SectionTemplate

The post section of this group.

__init__(key, group, heading, heading_id, subject, benchmark='their benchmarks', metric='one_month_cagr_best', measure='equity', ranked_by='by 3M return', link='tradingstrategy.ai/vaults', intro='')
Parameters
  • key (str) –

  • group (str) –

  • heading (str) –

  • heading_id (str) –

  • subject (str) –

  • benchmark (str) –

  • metric (str) –

  • measure (Literal['equity', 'sharpe']) –

  • ranked_by (str) –

  • link (str) –

  • intro (str) –

Return type

None