Skip to content

dotam99/bal-mining-scripts

 
 

Repository files navigation

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

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 89.9%
  • Python 4.3%
  • TypeScript 3.6%
  • JavaScript 2.2%