Coder Social home page Coder Social logo

cadlabs / ethereum-economic-model Goto Github PK

View Code? Open in Web Editor NEW
127.0 127.0 34.0 254.22 MB

A modular dynamical-systems model of Ethereum's validator economics

Home Page: https://cadlabs.org

License: GNU General Public License v3.0

Python 4.19% Jupyter Notebook 95.49% Makefile 0.04% CSS 0.29%
cadcad economic-models ethereum jupyter model modelling python simulation

ethereum-economic-model's People

Contributors

allcontributors[bot] avatar barnabemonnot avatar benschza avatar dependabot[bot] avatar emailtovamos avatar hackmd-deploy avatar jgbsci avatar marthendalnunes avatar rogervs avatar yuta0x89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-economic-model's Issues

Workstream 1: Ethereum stochastic processes - ETH staked

  • Efficiently research the best way to fit a stochastic process for validator ETH staked
  • Design a mechanism for updating the ETH staked in the model
    • Determine semantic and functional reasons for creating a process for ETH staked vs. number of validators
    • Design feedback loop with KPI (e.g. required yield, ETH price volatility) driving staking of ETH

Add Eth1 inflation mechanism to model

Implement either a static inflation rate, or some reasoned process of dynamic inflation, for the Eth1 inflation rate. The Eth2 inflation is a result of the rewards, penalties, and EIP1559.

Workstream 1: Ethereum stochastic processes - ETH price

  • Efficiently research the best way to fit a stochastic process for different ETH price scenarios (best case, worst case, base case)
    • Determine the best distributions available for selection
  • Design and implement a mechanism for historical price integration from external API source
  • Design a mechanism for applying ETH price shocks of different forms, to the stochastic process, historical price, and stable price scenarios

Update EIP1559 assumptions

See Economic Report spreadsheet https://docs.google.com/spreadsheets/d/1y18MoYSBLlHZ-ueN9m0a-JpC6tYjqDtpISJ6_WdicdE/, tab ETH1 Tx & Gas Analysis:

  • Update 6 months average for gas per transaction eip1559_avg_gas_per_transaction
  • Update 6 months average for tx/day eip1559_avg_transactions_per_day
  • Validate choice of eip1559_basefee
  • Validate choice of eip1559_avg_tip_amount

Notes from review with Barnabe (needs to be validated):

Review of Ethereum phases logic

To review:

  • Phase transitions, and use of phases to enable/disable logic at different milestones
  • policy_phases(...) in phases.py
  • Phase enum in types.py

Scoping: ETH price process

This issue is created to get the review and input of @danlessa

In the worksession, @rogervs suggested applying the ETH price process as a post-processing transform of ETH rewards and penalties. So essentially the model would only contain ETH states.

To summarize, this would mean:

  • Model simplified in runtime
  • UX improved being able to efficiently swap ETH price processes without re-running experiment
  • All metrics calculated in post-processing which likely improves model performance

The potential downsides of this refactor:

  • If we want to make the model more complex and apply shocks to the ETH price process and have the intention of a metric being in a feedback loop causing validators to exit, then we'd need to re-introduce the logic in runtime. Basically, if we want any policy or mechanism to depend on the ETH price, then we'd need to re-introduce it.

The benefit of removing the metrics and ETH price process, assuming we don't need to prematurely optimize the model, is in the UX of being able to swap ETH price processes in post-processing.

See https://hackmd.io/@benschza/S1gT6PvEO for worksession notes.

Workstream 2: Eth2 validator economics calculator

  • Analyse and compare cadCAD web app frameworks and integrations (e.g. Streamlit, HoloViews, Dash (Plotly))
  • Create a POC integration of a minimal Eth2 cadCAD model into the web app framework with illustrative parameter selection/scenarios (e.g. drop-downs, sliders, various options)
  • Draft layout of the Eth2 Masterclass validator economics dashboard using the chosen web app framework in close collaboration with Edu team (research and motivate options)

Review model module naming conventions

Currently, the model modules are as follows:

  • accounting.py
  • ethereum.py
  • proof_of_stake.py
  • eip1559.py
  • etc.

Consider refactoring if necessary to make these classifications more clear. Barnabe suggested finalization and justification as concepts worth considering: https://our.status.im/two-point-oh-justification-and-finalization/ . @rogervs suggested looking at the Eth2 spec. test suite to see what the architecture is.

Accessibility and value for learning should be prioritized, and sticking to the existing Eth2 spec and standard terminology.

Scoping: Model phases

The current hypothesis is that we will not implement phases, and will instead make the assumption that the model is operating post-merge.

The following mechanisms affect validator yield economics, and are implemented in phases:

  • EIP1559 implemented (only rewards Eth1 miners until phase 2)
  • Transactions being enabled in phase 2 (EIP1559 rewards both Eth1 miners and Eth2 validators)
  • Supply inflation - PoW block rewards gradually decrease (big assumption, under current network conditions?):

See https://docs.ethhub.io/ethereum-roadmap/ethereum-2.0/eth-2.0-phases/

In Phase 0, 1, and 2 the main PoW chain (Eth1) will remain live while testing and transitioning is happening on the Eth2 chain. This means that rewards will be paid to both Ethereum 2.0 validators as well as the normal PoW block rewards. Therefore, the combined inflation of the two chains may spike initially but then start to trend towards the 0-1% range as the PoW chain is gradually de-emphasized.

Expected Merge date fix, other small things

Hey all, thanks so much for creating such a great resource for the community! A few suggestions from checking back in on the site:

  • change the default "community consensus (March 2022)" to June 2022, as June seems much more likely and we are already in March. (same for optimistic I guess)
  • it also looks like the issuance data is stuck in August 2021, would it be possible to backfill this data?
  • looks like there are two "Proof of Stake" items represented in purple and red

image

Scoping: Validator/ETH staked closed-loop process

As discussed in the work session on Friday 26th March, the following is a brainstorm of a MVP implementation of a validator entry/exit process that depends on the current system state or metrics. It is undecided if we will implement this, or rather suggest it as a future addition to the model.

Different scenarios for validator exit:

  • Excessive penalties and slashing in extreme scenarios (this would only impact those being penalized, perhaps causing them to exit)
  • A crashing ETH price, a loss of confidence in the long term value of ETH - investor archetype leaves
  • Cost of validating increases causing validators to exit or move to another validator group (cloud, SaaS, DIY, etc.) (unclear what would cause this though)
  • RSAVY type metric reaches threshold (window function applied to introduce a long term outlook on returns)

The question of how to model a distribution for those who decide to leave in these conditions was discussed:

  • Look at historical ETH price events, such as 2017 market price crash, and see distribution of those who HODL vs. liquidate - unclear exactly how to get these metrics, would need analysis of wallet activity likely, or approximation from something like exchange or Uniswap pool activity?
  • We could assume DIY == HODL, and make other such similar assumptions to create a model

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.