Holdr Protocol Overview
  • Protocol Overview
  • Developer Docs
  • Product
    • Overview
    • The Vault
    • Pools
      • Weighted Pools
      • Composable Stable Pools
      • Liquidity Bootstrapping Pools (LBPs)
    • Smart Order Router
  • Concepts
    • Math
      • Weighted Math
      • Stable Math
    • Fees
  • Ecosystem
    • Governance
    • veHLDR and Gauges
      • veHLDR
        • How veHLDR Works
        • How To Use veHLDR
        • How veHLDR Boosting Works
          • Working Supply
          • Calculating My Boost
          • Minimum veHLDR for Max Boost
      • Gauges
        • How Gauges Work
  • Developers
    • Deployment Addresses
  • Getting Started
    • FAQs
      • Swapping
      • Liquidity
      • Liquidity Mining with the veHLDR and Gauge System
      • Fees
      • The Vault
      • Pools and LBPs
Powered by GitBook
On this page
  • Overview
  • Invariant
  1. Concepts
  2. Math

Weighted Math

PreviousMathNextStable Math

Last updated 2 years ago

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.

Holdr'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 . Holdr'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_tBt​ 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