Skip to content

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

WeekStart BlockEnd Block
11017669010221761
21022176110267003
31026700310312236
41031223610357402
51035740210402520
61040252010447836
71044783610493044
81049304410538187
91053818710583488
101058348810628811
111062881110674230
121067423010719753
131071975310765333
141076533310811169
151081116910856779
161085677910902386
171090238610947679
181094767910992408
191099240811037419
201103741911083026
211108302611128711
221112871111174328
231117432811219938
241121993811265559
251126555911311151
261131115111356700
271135670011402291
281140229111447731
291144773111493367
301149336711538966
311153896611584641
321158464111630234
331163023411675866
341167586611721455
351172145511766939
361176693911812442
371181244211857946
381185794611903479
391190347911948959
401194895911994473
411199447312039857
421203985712085254
431208525412130764

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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages