Weighted Math

Overview

Weighted Math is designed to allow for swaps between any assets whether or not they have any price correlation. Prices are determined by the pool balances, pool weights, and amounts of the tokens that are being swapped.

Balancer's Weighted Math equation is a generalization of the xy=kx*y=k constant product formula, accounting for cases with n2n \geq2 tokens as well as weightings that are not an even 50/50 split.

Invariant

The value function VV is defined as:

V=iBtWtV=\prod_i Β_t^{Wt}

Where:

  • tt ranges over the tokens in the pool

  • BtB_t is the balance of the token in the pool

  • WtW_t​is the normalized weight of the tokens, such that the sum of all normalized weights is 1.

Learn more

Last updated