VaultProperty

Documentation for eth_defi.vault_report.charts.VaultProperty Python class.

class VaultProperty

Bases: object

A vault property shown under the vault name: its curator, protocol or chain.

Properties are drawn in the order curator, protocol, chain, each with its own icon, see add_property_rows(). They are made by eth_defi.vault_report.report.make_vault_properties(), which leaves out a curator or chain that repeats the protocol, and their logos are then replaced with trimmed ones by trim_logos(). Used in the performance chart legends, the inflows and outflows chart and, rasterised, the hero image.

Attributes summary

text

Label text, e.g.

logo_uri

Logo data URI, see eth_defi.vault_report.logos, or None to draw the text only

logo_aspect

Logo width divided by its height, after trim_logos() removes its margins

icon_size

Drawn icon width and height in pixels.

Methods summary

__init__(text[, logo_uri, logo_aspect])

text: str

Label text, e.g. Steakhouse Financial, Morpho or Base

logo_uri: Optional[str]

Logo data URI, see eth_defi.vault_report.logos, or None to draw the text only

logo_aspect: float

Logo width divided by its height, after trim_logos() removes its margins

property icon_size: tuple[float, float]

Drawn icon width and height in pixels.

Icons are PROPERTY_ICON_SIZE tall; wide logos are scaled down to at most PROPERTY_MAX_ICON_ASPECT times that width. Sizing the box to the trimmed logo’s own shape, rather than drawing every logo in a square, puts every icon the same distance from its text. Wordmark-like logos are capped, so they do not dominate the row.

__init__(text, logo_uri=None, logo_aspect=1.0)
Parameters
Return type

None