Giter Club home page Giter Club logo

bal-mining-scriptsjircs'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.

Starting on week 57 of the liquidity mining program (June 28th 2021), pools can be incentivized with multiple tokens. Each weekly report directory has the following structure:

  • __<network>_<token>.json files, containing a list of liquidity providers and the amount of <token> earned by each for providing liquidity in incentivized Balancer pools on <network>
  • _totalsLiquidityMining.json: for consistency with the reports provided in previous weeks, contains a list of liquidity providers and BAL earned across all networks
  • _gasResimbursement.json: results of the BAL for Gas program for the week, if applicable
  • _totals.json: total amount of BAL to be claimed on Ethereum mainnet (__ethereum_0xba1... + _gasResimbursement.json)

Requirements

Setup

  • Install required packages: pip install -r requirements.txt
  • Configure environment variable:
    • GOOGLE_APPLICATION_CREDENTIALS: path to a JSON file that contains a service account key with read access to Google BigQuery

Usage

python3 run.py

Weekly distributions

145,000 BAL will be distributed on a weekly basis.
Liquidity providers must claim their BAL at app.balancer.fi, polygon.balancer.fi or arbitrum.balancer.fi.

Redirections

In case smart contracts which cannot receive tokens are liquidity providers (ie. hold the tokens that represent ownership of the pool), owners of those smart contracts can choose to redirect their liquidity mining incentives to a new address. In order to submit a redirection request, submit a pull request to update config/redirect.json using "fromAddress" : "toAddress" along with some sort of ownership proof. Please reach out to the Balancer team if you need assistance.

Opting out

Liquidity providers can choose to opt out of liquidity mining incentives. In order to do so, they must submit a pull request as per the instructions below along with some sort of proof of ownership of the address. Please reach out to the Balancer team if you need assistance.

Opting out of specific pools

Add your address to the file config/exclude.json, which has the following structure;

{
  "chain_id": {
    "pool_address": [
      "liquidity_provider_a",
      "liquidity_provider_b",
      ...
    ],
    ...
  },
  ...
}

Opting out of liquidity mining altogether

Add your address to BASE_LP_EXCLUSION_LIST in src/query_gbq.py

BASE_LP_EXCLUSION_LIST = [
    '0x0000000000000000000000000000000000000000',
    '0xba12222222228d8ba445958a75a0704d566bf2c8'.
    '<insert_address_here>'
]

bal-mining-scriptsjircs's People

Contributors

markusbkoch avatar mikemcdonald avatar rabmarut avatar gtaschuk avatar bonustrack avatar decaf-addict avatar fernandomartinelli avatar cryptjs13 avatar alsco77 avatar jondevx avatar dmvt avatar chi-antai avatar amit-rally avatar thowar2 avatar maximus-vesta avatar 37aces avatar alexintosh avatar mendesfabio avatar kaiynne avatar meirbank avatar mickdegraaf avatar the-3d avatar doncesarts avatar jin10086 avatar gerrrg avatar

Stargazers

Trading23 avatar

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.