Balancer Basics

Understanding AMMs (Automated Market Makers)

The foundations for AMMs lie with a mathematical rule called an invariant. An invariant is a property that remains unchanged even after the application(s) of transformations. In the context of AMMs, this means that the result of the function applied to the number of assets remains the same after the transaction is completed.

One of the first use-cases of an invariant in the context of AMMs was implemented in Uniswap:

xy=invariantx*y = invariant

where x - balance of ETH, y - balance of ERC20 token

The Balancer AMM

To support multi-token pools, Balancer V2 proposed a different invariant with different weights assigned to each token:

V=tBtWtV = \prod _tB_t^{W_t}

where V is constant, B is an asset's balance, and W is an asset's weight in the pool.

As the price of each token changes, arbitrageurs rebalance the pool by making trades. This maintains the desired weighting of the value of each token meanwhile collecting trading fees from the traders.

Last updated