The Value Function

The center building block for all Balancer Protocol pools and swaps stems from the value function. Learn more in this section.

The invariant, or Value Function, of Balancer Weighted Pools is critical for maintaining pool value and fair swap prices. . This weighted constant product equation facilitates pools of assets with fluctuating prices with respect to one another. Fluctuations inherently lead to price impact, which creates r arbitrage opportunities for rebalancing the pool to market price. Another consequence of this mechanism is impermanent loss, or divergence loss. What does this mean to a user and what is different between two token and multiple token pools? We will look at several examples to explain the differences.

Value Function:

Where

  • t ranges over the tokens in the pool

  • Bt is the balance of the token in the pool

  • Wt is the normalized weight of the token, such that the sum of all normalized weights is 1.

t

Essentially t represents how many tokens there are in a pool. We will do even splits to start (33/33/33) and look at when we have uneven weights (80/20) afterwards.

Bt

Bt is the balance of the token but this is not to be confused with the universal cost of the token. The pool is only as aware of prices as its contents dictate. The market of traders are responsible for (and financially incentivised to) making the value match the rest of the market.

For general use:

The USD value of the balance of a given token within the pool is dependent upon an external definition of price, often supplied by CoinGecko:

Wt

Wt is the weight of the token in the pool. If a pool is well balanced with market prices, the weight of a token corresponds to how much of the pool’s value is denominated in that token.

Last updated