Coder Social home page Coder Social logo

ichifarm / bal-mining-scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balancer/bal-mining-scripts

0.0 2.0 1.0 94.53 MB

License: GNU General Public License v3.0

JavaScript 1.48% TypeScript 2.47% Jupyter Notebook 93.09% Python 2.97%

bal-mining-scripts's Introduction

BAL Mining

Set of scripts to calculate weekly BAL liquidity mining distributions.

On week 26, the process was ported over to Python with the blockchain-etl project on Google Bigquery as the source for state data, such as pools' balances, fees, liquidity providers etc. The legacy scripts used up to week 25 can be found in the js directory.

Historical Runs

Week Start Block End Block
1 10176690 10221761
2 10221761 10267003
3 10267003 10312236
4 10312236 10357402
5 10357402 10402520
6 10402520 10447836
7 10447836 10493044
8 10493044 10538187
9 10538187 10583488
10 10583488 10628811
11 10628811 10674230
12 10674230 10719753
13 10719753 10765333
14 10765333 10811169
15 10811169 10856779
16 10856779 10902386
17 10902386 10947679
18 10947679 10992408
19 10992408 11037419
20 11037419 11083026
21 11083026 11128711
22 11128711 11174328
23 11174328 11219938
24 11219938 11265559
25 11265559 11311151
26 11311151 11356700
27 11356700 11402291
28 11402291 11447731
29 11447731 11493367
30 11493367 11538966
31 11538966 11584641
32 11584641 11630234
33 11630234 11675866
34 11675866 11721455
35 11721455 11766939
36 11766939 11812442
37 11812442 11857946
38 11857946 11903479
39 11903479 11948959
40 11948959 11994473
41 11994473 12039857
42 12039857 12085254
43 12085254 12130764
44 12130764 12176303
45 12176303 12221872
46 12221872 12267212
47 12267212 12312588

Requirements

  • Python 3 + Jupyter Notebook
  • An ethereum node (for querying blocks timestamps and token decimals)
  • A service account key with read access to Google BigQuery

Setup

  • Install required packages: pip install -r requirements.txt
  • Configure environment variables:
    • ENDPOINT_URL: URL to an ethereum node that can be queried via Websockets
    • GOOGLE_APPLICATION_CREDENTIALS: path to a JSON file that contains a service account key with read access to Google BigQuery

Usage

  1. Start Jupyter Notebook: jupyter notebook
  2. Open the bal-mining.ipynb notebook
  3. Run all cells
  4. Plots are displayed throughout the notebook. JSON reports are stored in the reports directory, with a final tally of user address to BAL received stored in the report week folder at _totals.json

Weekly distributions

145,000 BAL will be distributed on a weekly basis. Liquidity providers must claim their BAL at claim.balancer.finance.

BAL Redirections

In case smart contracts which cannot receive BAL tokens are specified, owners of those smart contracts can choose to redirect BAL tokens to a new address. In order to submit a redirection request, submit a pull request to update redirect.json using "fromAddress" : "toAddress" along with some sort of ownership proof. Please reach out to the Balancer team if you need assistance.

BAL Redistributions

The mining script identifies the liquidity providers of configurable rights pools (CRPs) deployed via the CRPFactory and redistributes BAL earned by those pools appropriately. CRPs deployed via other methods should submit a pull request to update redistribute.json using "controllerAddress" : "poolDescription" along with some sort of ownership proof. Please reach out to the Balancer team if you need assistance.

bal-mining-scripts's People

Contributors

mikemcdonald avatar markusbkoch avatar rabmarut avatar gtaschuk avatar bonustrack avatar fernandomartinelli avatar alsco77 avatar jondevx avatar dmvt avatar chi-antai avatar amit-rally avatar thowar2 avatar 37aces avatar alexintosh avatar kaiynne avatar 0xmeir avatar mickdegraaf avatar the-3d avatar jin10086 avatar

Watchers

James Cloos avatar  avatar

Forkers

cryptopossum

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.