Balancer
Balancer V2
Balancer V2
  • Protocol Overview
  • Developer Docs
  • Products
    • The Vault
      • Flash Loans
    • Balancer Pools
      • Weighted Pools
      • Composable Stable Pools
      • Liquidity Bootstrapping Pools (LBPs)
      • Managed Pools
        • Asset Managers
      • Boosted Pools
      • Custom Pools
    • Smart Order Router
    • Balancer CoW Protocol
    • Oracles (deprecated)
  • Concepts
    • Math
      • Weighted Math
      • Stable Math
    • Fees
  • Ecosystem
    • Governance
      • Governance Process
        • RFC/Proposal Forum Post Template
      • BAL Governance Token
      • Snapshot
      • Multisig
        • Other DAO Multisigs
      • Governable Protocol Fees
      • Emergency subDAO
    • Community
      • Ballers
      • Delegation
      • Grants
    • veBAL and Gauges
      • veBAL
        • How veBAL Works
        • How To Use veBAL
        • How veBAL Boosting Works
          • Working Supply
          • Calculating My Boost
          • Minimum veBAL for Max Boost
        • BIP19 and Yield Bearing Tokens
      • Gauges
        • How Gauges Work
        • How To Use Gauges
  • Security
    • Audits
    • Bug Bounties
    • Emergency Pause
    • Token Compatibility
    • Balancer x Certora Accelerator
  • Getting Started
    • FAQs
      • Swapping
      • Liquidity
      • Liquidity Mining with the veBAL and Gauge System
      • Liquidity Mining (Legacy)
      • Fees
      • Governance
      • The Vault
      • Pools and LBPs
      • Asset Managers
      • Oracles
      • About Balancer Protocol and Labs
      • V2 in a Nutshell
      • V1 ➝ V2 Migration
    • Walkthroughs
      • Trade
      • Invest
    • Contribution Guide
  • Community
    • Discord
    • Forums
    • Medium
    • Dune Analytics
  • Developers (Deprecated)
    • !!! DEPRECATED !!! ⛔
    • Guides
      • Pool Verification
    • Smart Order Router V2
    • GitHub
Powered by GitBook
On this page
  • Overview
  • Invariant

Was this helpful?

  1. Concepts
  2. Math

Weighted Math

PreviousMathNextStable Math

Last updated 3 years ago

Was this helpful?

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 x∗y=kx*y=kx∗y=k constant product formula recommended for Automated Market Makers (AMMs) in . Balancer's generalization accounts for cases with n≥2n \geq2n≥2 tokens as well as weightings that are not an even 50/50 split.

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

For more weighted math formulas, .

Invariant

The value function VVVis defined as:

V=∏tBtWtV= \prod_t B_t^{W_t}V=t∏​BtWt​​

Where

  • ttt ranges over the tokens in the pool

  • BtB_t Bt​ is the balance of the token in the pool

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

a post by Vitalik Buterin
check out the Developer Docs