Liquidity Lu saysBalancer pools generalize the constant product to N tokens with arbitrary weights: the invariant ∏(B_i^w_i) replaces 50/50 with any allocation that sums to 1.
Balancer generalizes Uniswap to N tokens with arbitrary weights. The invariant is V = ∏ B_i^(w_i) with weights w_i summing to 1. A classic 80/20 pool gives an LP 80% exposure to one asset and 20% to another. Spot price between two tokens is (B_b/w_b) / (B_a/w_a).
This lets a single pool act as a self-balancing index fund — perfect for governance tokens that want exposure to ETH without selling. The demo computes spot price and the invariant for an 800/200 pool with 80/20 weights.
Power-ups you unlock
Invariant: V = ∏ B_i^(w_i), weights sum to 1
Generalizes constant-product (= equal weights, two tokens)
Spot price: (B_b/w_b) / (B_a/w_a)
80/20 pools act as self-balancing index funds
Supports up to 8 tokens per pool
The Sandwich Bot attacks — common mistakes
Forgetting weights must sum to 1
Using weighted pools for stable assets (use stableswap)
Ignoring impermanent loss at higher weight asymmetry
Confusing the invariant V with TVL
Boss battleFor a (800, 200) pool with weights (0.8, 0.2), compute the spot price and the invariant V.