ERC-4626: analyse performance of individual vaults

  • In this notebook, we examine a single or handful of handpicked ERC-4626 vaults

    • Vaults are picked manually by (chain, address) list

    • We analyse the vault performance by its share price, as reported by ERC-4626 smart contract interface.

    • We do last three months and historical all-time analyses

    • We look quantitative finance aspects of the vaults like returns, Sharpe and Sortino numbers

Some notes - Because of how vault metrics, share price and such are collected and interpreted, the results in this notebook contain various inaccuracies. - In this notebook, we use terms Net Asset Value (NAV) and Total Value Locked (TVL) interchangeably.

Usage

This is an open source notebook based on open data - You can edit and remix this notebook yourself

To do your own data research:

  • Read general instructions how to run the tutorials

  • See ERC-4626: scanning vaults' historical price and performance example in tutorials first how to build vault-prices-1h.parquet file.

For any questions, follow and contact Trading Strategy community.

Setup

  • Set up notebook rendering output mode

  • Use static image charts so this notebook is readeable on Github / ReadTheDocs

[8]:
import pandas as pd
from plotly.offline import init_notebook_mode
import plotly.io as pio

from eth_defi.vault.base import VaultSpec
from eth_defi.research.notebook import set_large_plotly_chart_font

pd.options.display.float_format = "{:,.2f}".format
pd.options.display.max_columns = None
pd.options.display.max_rows = None


# Set up Plotly chart output as SVG
image_format = "png"
width = 1400
height = 800

# https://stackoverflow.com/a/52956402/315168
init_notebook_mode()

# https://plotly.com/python/renderers/#overriding-the-default-renderer
pio.renderers.default = image_format

current_renderer = pio.renderers[image_format]
# Have SVGs default pixel with
current_renderer.width = width
current_renderer.height = height

# Set all Plotly charts to use large font sizes for better readability,
# for sharing on mobile
set_large_plotly_chart_font(line_width=5, legend_font_size=16)
pio.templates.default = "custom"