ERC-4626: vault report for blog posts
This is the same as ERC-4626 best vaults notebook, but tailored for the blog post output
The output is condensed with less charts, lists and data points
Tables are outputted as Markdown for copy-paste and the rendering is left to the blog engine
Vaults are ranked by 1M returns unless noted otherwise
Setup
Set up notebook rendering output mode
Use static image charts so this notebook is readeable on Github / ReadTheDocs
[1]:
import pandas as pd
from plotly.offline import init_notebook_mode
import plotly.io as pio
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://stackoverflow.com/a/74609837/315168
assert hasattr(pio, "kaleido"), "Kaleido rendering backend missing. Run 'pip install kaleido' needed for this notebook"
pio.kaleido.scope.default_format = image_format
# 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"