Balancer, which launched in 2019, is a variation of constant function automatic matchmaker (CFMM) that allows for multi-asset liquidity pools holding two or more tokens.
Per DefiLlama, Balancer is the 3rd largest DEX by TVL on Ethereum, behind Uniswap and Curve.
It’s worth considering and understanding based on opportunity size alone, but also because its similarity to other CFMMs makes developing abstractions for it rather simple.
White Paper
The original white paper can be downloaded from the Balancer V1 gitbook. I recommend downloading a copy of it and having it nearby as you read along.
The whitepaper describes a Balancer pool as a “self-balancing weighted portfolio” which is “based on an N-dimensional surface defining a cost function for the exchange of any pair of tokens.”
Recall that Uniswap V2 pools are CFMMs based on the famous x*y=k invariant. The Balancer invariant is based on the so-called Value Function V, which is defined:
Where: