Skip to content

Commit

Permalink
Ben/notebook viz generation (#103)
Browse files Browse the repository at this point in the history
* Update viz

* Cherrypick text updates

* Update notebooks
  • Loading branch information
BenSchZA authored Jul 16, 2021
1 parent a3d15ba commit eb25c32
Show file tree
Hide file tree
Showing 7 changed files with 781 additions and 523 deletions.
26 changes: 21 additions & 5 deletions experiments/notebooks/2_validator_revenue_and_profit_yields.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@
"from model.state_variables import eth_staked, eth_supply"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "31f4b5c9-07cb-44ea-8bb0-15cd478df178",
"metadata": {},
"outputs": [],
"source": [
"%%html\n",
"<style>\n",
"/* Set dark-theme button opacity - see https://github.com/plotly/plotly.py/issues/3120 */\n",
".updatemenu-item-rect {\n",
" fill-opacity: 0.3 !important;\n",
"}\n",
"</style>"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -140,7 +156,7 @@
"\n",
"The third chart (\"Revenue or Profit Yields Over Time\") depicts revenue yields or profit yields (choose using button selector) over the chosen time frame and across the three adoption scenarios (i.e. implied ETH staked over time), and ETH price range. In simple terms, this chart depicts how validators can expect the yield dynamics to change over different adoption and price scenarios. The higher the adoption, the lower both revenue and profit yields. The higher the price, the higher the profit yields.\n",
"\n",
"The fourth chart (\"Cumulative Average Revenue or Profit Yields Over Time\") depicts the cumulative average revenue yields or profit yields (choose via button selector) over the chosen time frame, and across the three adoption scenarios (i.e. implied ETH staked over time) and ETH price range. In simple terms, this chart depicts the effective yields a validator can expect over the respective time horizons if they start validating today. The higher the adoption, the lower both revenue and profit yields. The higher the price, the higher the profit yields."
"The fourth chart (\"Cumulative Revenue or Profit Yields Over Time\") depicts the cumulative revenue yields or profit yields (choose via button selector) over the chosen time frame, and across the three adoption scenarios (i.e. implied ETH staked over time) and ETH price range. In simple terms, this chart depicts the effective yields a validator can expect over the respective time horizons if they start validating today. The higher the adoption, the lower both revenue and profit yields. The higher the price, the higher the profit yields."
]
},
{
Expand Down Expand Up @@ -195,7 +211,7 @@
"metadata": {},
"outputs": [],
"source": [
"visualizations.plot_revenue_profit_yields_over_time_foreach_subset_subplots(\n",
"visualizations.plot_yields_per_subset_subplots(\n",
" df_1,\n",
" subplot_titles=['Normal Adoption', 'Low Adoption', 'High Adoption']\n",
")"
Expand All @@ -208,17 +224,17 @@
"metadata": {},
"outputs": [],
"source": [
"visualizations.plot_revenue_profit_yields_over_time_foreach_subset(df_1)"
"visualizations.plot_yields_per_subset(df_1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f7caa5b3",
"id": "9dd21cde-b26b-4985-9047-74c09d0b5587",
"metadata": {},
"outputs": [],
"source": [
"visualizations.plot_expanding_mean_revenue_profit_yields_over_time_foreach_subset(df_1)"
"visualizations.plot_cumulative_yields_per_subset(df_1)"
]
},
{
Expand Down
40 changes: 32 additions & 8 deletions experiments/notebooks/3_network_issuance_and_inflation_rate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,28 @@
"from datetime import datetime\n",
"\n",
"import experiments.notebooks.visualizations as visualizations\n",
"from experiments.notebooks.visualizations.peak_eth_simulator import run_peak_eth_simulator\n",
"from experiments.notebooks.visualizations.eth_supply_simulator import run_eth_supply_simulator\n",
"from experiments.run import run\n",
"from model.types import Stage\n",
"from data.historical_values import df_ether_supply"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ca8de2a7-46be-4c8f-ba91-3663428c1db8",
"metadata": {},
"outputs": [],
"source": [
"%%html\n",
"<style>\n",
"/* Set dark-theme button opacity - see https://github.com/plotly/plotly.py/issues/3120 */\n",
".updatemenu-item-rect {\n",
" fill-opacity: 0.3 !important;\n",
"}\n",
"</style>"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -206,10 +222,10 @@
" * High adoption: assumes an average of 4.5 new validators per epoch, i.e. a 50% higher rate compared to the base scenario\n",
"* Proof-of-Stake Activation Date\n",
" * Four scenarios starting from 1 Decemeber 2021 in quarterly increments \n",
"* EIP1559 Base Fee and Average Priority Fee (Gwei per gas). \n",
" * Steady State: base fee = 100 and priority fee = 1 to indicate the expected steady state at current gas prices\n",
" * MEV: base fee = 70 and tip = 30 to indicate the expected influence of MEV on the resulting blockspace auction\n",
" * EIP1559 disabled: base fee = 0 and priority fee = 0 to indicate EIP1559 being disabled\n",
"* EIP1559 Base Fee and Average Priority Fee (Gwei per gas)\n",
" * EIP1559 Enabled / No MEV: Base Fee 100, Priority Fee 1 (steady state at current gas prices)\n",
" * EIP1559 Enabled / MEV: Base Fee 70, Priority Fee 30 (models potential influence of MEV on blockspace auction)\n",
" * EIP1559 Disabled: Base Fee 0, Priority Fee 0\n",
"\n",
"The first chart (\"Inflation Rate and ETH Supply Analysis Scenarios\") depicts the ETH supply for default scenarios of the Validator Adoption, Proof-of-Stake Activation Date, and EIP1559 scenario categories, side by side (choose via button selector). This allows comparative analysis for each category.\n",
"\n",
Expand Down Expand Up @@ -239,15 +255,23 @@
"outputs": [],
"source": [
"logger.disabled = True\n",
"run_peak_eth_simulator(execution_mode='inline')\n",
"run_eth_supply_simulator(execution_mode='inline')\n",
"\n",
"# To display in new browser tab at http://127.0.0.1:8050/:\n",
"# run_peak_eth_simulator(execution_mode='external')\n",
"# run_eth_supply_simulator(execution_mode='external')\n",
"\n",
"# To display either in \"inline\" mode when using Jupyter Notebook,\n",
"# or \"jupyterlab\" mode when using Jupyter Lab:\n",
"# run_peak_eth_simulator()"
"# run_eth_supply_simulator()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a8c4f60f-3091-450b-8b8d-4929369ac816",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit eb25c32

Please sign in to comment.