balancer_constants.py

This page explains Balancer constants variables

Path: balancer_constants.py file discussed in this article.

from decimal import Decimal

ONE_WEI = Decimal('0.000000000000000001')
BONE = Decimal('1')
MIN_BOUND_TOKENS = 2
MAX_BOUND_TOKENS = 8
MIN_FEE = Decimal('0.000001')
MAX_FEE = Decimal('0.1')
EXIT_FEE = 0
MIN_WEIGHT = BONE
MAX_WEIGHT = BONE * Decimal('50')
MAX_TOTAL_WEIGHT = BONE * Decimal('50')
MIN_BALANCE = Decimal('0.000000000001')
INIT_POOL_SUPPLY = BONE * Decimal('100')
MIN_BPOW_BASE = Decimal('0.000000000000000001')
MAX_BPOW_BASE = (Decimal('2') * BONE) - ONE_WEI
BPOW_PRECISION = BONE / Decimal('10000000000')
MAX_IN_RATIO = BONE / Decimal('2')
MAX_OUT_RATIO = (BONE / Decimal('3')) + ONE_WEI
  • ONE_WEI: the unit of gas price measurement 10^-18 of Ether

  • BONE

  • MIN_BOUND_TOKENS: the minimal number of composite tokens in Balancer pool (e.g. the pool of two tokens - WETH/DAI)

  • MAX_BOUND_TOKENS: the maximal number (a limit) of composite tokens in Balancer pool (e.g. the index portfolio of 8 tokens like PowerIndex: YFI AAVE SNX MKR CVP COMP WNXM UNI)

  • MIN_FEE: minimal swap fee in decimals. It means that 0.000001 corresponds 0.0001%, and 0.1 corresponds 10%

  • EXIT_FEE: fee for exiting the pool (redeeming BPT token for underlying assets)

  • MIN_WEIGHT: the minimal possible weight of token in the pool. It means that weight cannot be below this magnitude, and the next value is zero (the token is completely removed from the pool)

  • MAX_WEIGHT

  • MAX_TOTAL_WEIGHT: max weight of one asset in the pool

  • MIN_BALANCE: minimal possible balance of one asset in the pool

  • INIT_POOL_SUPPLY: the initial supply of BPT tokens (pool shares).

  • MIN_BPOW_BASE

  • MAX_BPOW_BASE

  • BPOW_PRECISION

  • MAX_IN_RATIO

  • MAX_OUT_RATIO

Last updated