Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Geometric Mean Market Maker (G3M)

An Automated Market Maker (AMM) whose pricing invariant is based on the weighted geometric mean of its reserve assets, generalizing the Constant Product Market Maker.
Chainscore © 2026
definition
DEFINITION

What is a Geometric Mean Market Maker (G3M)?

A Geometric Mean Market Maker (G3M) is a type of automated market maker (AMM) whose liquidity pool reserves are governed by a constant product formula based on the geometric mean of the asset quantities.

A Geometric Mean Market Maker (G3M) is a decentralized exchange (DEX) liquidity pool where the relationship between the quantities of its constituent assets is defined by the equation ∏ x_i^{w_i} = k. Here, x_i represents the reserve amount of asset i, w_i is its normalized weight (where ∑ w_i = 1), and k is a constant. This generalizes the classic Constant Product Market Maker (CPMM) model, popularized by Uniswap V2, which uses equal weights (e.g., 0.5 and 0.5 for a two-asset pool). The geometric mean formula allows for customizable asset weights, enabling pools that are not necessarily 50/50, which is a foundational concept for Balancer-style pools.

The primary innovation of the G3M is its support for multi-asset pools beyond two tokens and asymmetric liquidity provisioning. By adjusting the weight parameters w_i, a pool can be tailored to specific use cases. For example, a stablecoin pool might have a 33/33/33 weight for three different pegged assets, while a portfolio-like pool could hold 80% of a governance token and 20% of a stablecoin. The weights directly influence price impact and impermanent loss profiles; a higher weight for an asset makes the pool's price for that asset more stable but also increases exposure to its volatility.

From a technical perspective, the G3M's invariant ensures that the spot price of any asset in the pool is determined by the ratio of its reserve to its weight, relative to another asset. The constant k changes only through the collection of trading fees or protocol-owned liquidity actions, not through normal swaps. This model provides immense flexibility, allowing for the creation of index funds, custom automated portfolio strategies, and capital-efficient stablecoin swaps directly within the AMM framework, without requiring an external price oracle for basic rebalancing logic.

etymology
TERM ROOTS

Etymology and Origin

This section traces the linguistic and conceptual origins of the Geometric Mean Market Maker (G3M), explaining how its name and mathematical foundation emerged from the evolution of automated market makers (AMMs).

The term Geometric Mean Market Maker (G3M) is a direct descriptor of its core mathematical invariant, the geometric mean, which distinguishes it from the simpler constant product market maker (CPMM) popularized by Uniswap V2. The 'G3' notation, sometimes seen as G³M, explicitly references the generalized constant mean market maker formula, where the exponent 'n' represents the number of assets in the pool. This nomenclature was formalized in academic and whitepaper literature to categorize AMMs by their bonding curve's underlying function.

The conceptual origin of the G3M is rooted in the desire to create liquidity pools for more than two assets without the significant impermanent loss associated with pairing each asset against a common base (like ETH or a stablecoin). While the CPMM uses the product of two reserves (x * y = k), the G3M generalizes this to the product of multiple reserves raised to a weight, typically expressed as ∏ x_i^{w_i} = k, where the sum of weights w_i equals 1. This mathematical framework allows for balanced multi-asset pools and was a key innovation for portfolios and index funds on-chain.

The development of the G3M is closely associated with Balancer Labs, whose 2018 whitepaper, "Balancer: A Non-Custodial Portfolio Manager, Liquidity Provider, and Price Sensor," introduced it as a non-custodial portfolio manager. The protocol's ability to act as a self-balancing weighted portfolio and a liquidity source for any combination of its assets cemented the G3M's role in DeFi architecture. Its evolution continues with versions (like Balancer V2) that separate the core G3M math from the vault architecture, improving gas efficiency and flexibility.

Understanding the G3M's origin is key to grasping its primary use cases: index funds, customizable pool weights, and low-slippage swaps between correlated assets within the same pool. The geometric mean invariant ensures that the pool's value is maintained when assets are traded, provided their relative prices remain stable. This makes G3Ms particularly suited for pools containing stablecoin pairs or tokens within the same ecosystem, where internal arbitrage helps maintain the intended weightings automatically.

The term and model have since been adopted and extended by other protocols. For instance, Curve Finance's stableswap invariant can be viewed as a hybrid between a constant sum and a constant product (G2M) market maker, optimized for minimal slippage between pegged assets. The G3M framework thus represents a fundamental building block in the automated market maker (AMM) design space, enabling more complex and capital-efficient DeFi primitives beyond simple token pairs.

key-features
GEOMETRIC MEAN MARKET MAKER (G3M)

Key Features and Properties

A Geometric Mean Market Maker (G3M) is an automated market maker (AMM) whose pricing curve is defined by the weighted geometric mean of its reserve assets, enabling concentrated liquidity and multi-asset pools.

01

Constant Product Invariant

The foundational G3M model for a two-asset pool is the Constant Product Market Maker (CPMM), defined by the invariant x * y = k. This formula ensures the product of the reserves of two assets (x and y) remains constant (k), creating a hyperbolic bonding curve where price changes are a function of the trade size relative to the pool's liquidity.

02

Generalized N-Asset Formula

For pools with n assets, the G3M invariant generalizes to the weighted product formula: ∏ (R_i)^(w_i) = k. Here, R_i is the reserve of asset i and w_i is its normalized weight, where the sum of all weights equals 1. This allows for the creation of index-like liquidity pools containing more than two assets.

03

Concentrated Liquidity via Weighting

Unlike a simple constant product, the weight parameters (w_i) in a G3M allow liquidity providers to concentrate capital within specific price ratios. By adjusting weights, a pool can be tuned to provide more liquidity around a target price, reducing slippage for expected trades and improving capital efficiency compared to an evenly weighted curve.

04

Impermanent Loss Profile

The geometric mean function creates a unique impermanent loss (divergence loss) profile for liquidity providers. Losses are minimized when the relative prices of assets in the pool remain near the ratio defined by their weights. Significant deviations from this target ratio result in greater impermanent loss, similar to but more customizable than a standard CPMM.

05

Relationship to Other AMMs

The G3M is a superset of common AMM curves:

  • Constant Sum Market Maker (CSMM): Emerges as a special case when weights are equal and the curve is linear (approximated at a single point).
  • Constant Mean Market Maker: A specific instance where all asset weights are equal (w_i = 1/n).
  • Balancer Pools: A prominent real-world implementation of the G3M model.
how-it-works
DEFINITION

How a Geometric Mean Market Maker Works

A Geometric Mean Market Maker (G3M) is an automated market maker (AMM) whose liquidity pool is structured to maintain a constant weighted geometric mean of its reserve assets, enabling more flexible and capital-efficient trading for diverse assets.

A Geometric Mean Market Maker (G3M) is defined by its invariant function: the product of each token reserve, raised to a corresponding weight, remains constant. The formula is expressed as ∏ R_i^w_i = k, where R_i is the reserve of token i and w_i is its normalized weight (∑ w_i = 1). Unlike a Constant Product Market Maker (CPMM) like Uniswap V2, which uses equal weights (e.g., 50/50 for a two-asset pool), a G3M allows for asymmetric weights (e.g., 80/20 or 98/2). This design enables liquidity providers (LPs) to tailor pools to specific asset correlations and risk profiles, reducing impermanent loss for stable pairs or concentrating capital where it's most needed.

The core mechanism governs price discovery and swap execution. When a trader swaps token A for token B, the smart contract calculates the required amount of B to give such that the invariant k is preserved post-trade. The resulting pricing curve is less steep than a CPMM's for assets with high weight disparity, leading to lower price impact for large trades on the dominant asset. This makes G3Ms particularly effective for liquidity bootstrapping pools and stablecoin pairs, where one asset is expected to maintain a relatively stable value. Prominent implementations include Balancer V2, which popularized the multi-token, variable-weight G3M model.

Key advantages of the G3M model include customizable pool compositions (supporting 2+ tokens), capital efficiency through tailored weights, and programmable fee structures. For example, a pool with 98% USDC and 2% of a new project's token allows efficient price discovery for the volatile asset with minimal stablecoin capital. However, complexity increases with more assets, and LPs must understand that weight imbalances amplify impermanent loss if the correlated price assumption fails. The G3M represents a significant evolution from fixed-curve AMMs, providing a foundational primitive for decentralized finance (DeFi) applications requiring sophisticated liquidity management.

mathematical-invariant
CORE PRINCIPLE

The Mathematical Invariant

At the heart of every Automated Market Maker (AMM) is a mathematical invariant, a constant function that defines the relationship between the assets in a liquidity pool and determines all trading prices.

A mathematical invariant in a decentralized exchange (DEX) is a rule or formula that must remain constant before and after every trade, deposit, or withdrawal in a liquidity pool. This invariant is the core pricing engine of an Automated Market Maker (AMM). The most famous example is the Constant Product Market Maker (CPMM) formula, x * y = k, where x and y represent the reserves of two tokens and k is the constant product. This simple rule ensures that as the quantity of one token decreases (is purchased), the quantity of the other must increase in a hyperbolic relationship, automatically setting the price based on the ratio of the reserves.

The Geometric Mean Market Maker (G3M), such as Balancer, generalizes this concept. Instead of a product of two reserves, it uses a weighted geometric mean as its invariant. For a pool with n tokens, the invariant is defined as ∏ (balance_i ^ weight_i) = k, where each token has a customizable weight_i that sums to 1. This allows for multi-asset pools (e.g., a 50/25/25 ETH/DAI/LINK pool) and flexible, non-50/50 weightings. The invariant ensures that the weighted geometric mean of the token reserves is constant, governing all price movements and enabling complex, capital-efficient portfolio management within a single pool.

The invariant's primary function is to algorithmically determine spot prices and price impact. When a trader submits a swap, the smart contract calculates the required output amount such that the invariant k is preserved. The resulting price is the marginal price at that specific reserve state. Large trades move the ratio of reserves significantly, causing slippage, which is a direct consequence of maintaining the invariant. This mechanism eliminates the need for order books and centralized price discovery, replacing it with a deterministic, code-governed pricing curve.

Beyond trading, the invariant is crucial for liquidity provider (LP) economics. When LPs deposit assets, they must do so in a precise ratio that maintains the pool's current invariant k, minting them LP tokens representing their share of the pool. The invariant also defines impermanent loss (divergence loss), which occurs when the external market price of the pooled assets diverges from the pool's internal ratio enforced by the invariant. The constant k creates a rebalancing effect that automatically sells the appreciating asset and buys the depreciating one, locking in a relative loss compared to simply holding the assets.

examples
GEOMETRIC MEAN MARKET MAKER (G3M)

Protocol Examples and Implementations

Geometric Mean Market Makers are a class of AMMs defined by a constant product formula. This section details prominent implementations, their unique features, and the core mathematical variants that power them.

04

The Constant Product Formula (x*y=k)

This is the defining mathematical rule of a basic two-asset G3M.

  • x and y represent the reserves of two tokens in the pool.
  • k is the constant product, which must remain unchanged by any trade.
  • Mechanism: When a trader buys Δx of token X, they must deposit enough Δy of token Y so that (x - Δx) * (y + Δy) = k. This creates a hyperbolic bonding curve where price changes continuously with pool composition.
  • It guarantees liquidity at all prices but can incur high slippage for large trades.
05

Impermanent Loss (Divergence Loss)

A fundamental risk for liquidity providers in any G3M, arising when the market price of deposited assets diverges from their price when deposited.

  • Cause: The AMM's constant product formula forces LPs to sell the appreciating asset and buy the depreciating asset to rebalance the pool.
  • Result: The value of the LP's pool share can become less than the value of simply holding the original assets.
  • Loss is "impermanent" because it is unrealized until withdrawal; prices could converge again.
  • It is most severe in volatile pairs and minimal in stablecoin pools like Curve.
COMPARISON

G3M vs. Other AMM Models

A feature and mechanism comparison of the Geometric Mean Market Maker (G3M) against other prevalent Automated Market Maker designs.

Feature / MechanismGeometric Mean (G3M)Constant Product (CPMM)Concentrated Liquidity (CLMM)StableSwap (Curve)

Core Invariant Formula

∏ x_i^w_i = k

x * y = k

x * y = k (within a range)

A * (x + y) + D = A * D + D³/(4xy)

Primary Use Case

Generalized multi-asset pools

Volatile asset pairs (e.g., ETH/USDC)

Capital efficiency for volatile pairs

Stable/pegged asset pairs

Price Impact Sensitivity

Configurable via weights (w_i)

High for large trades

Lower within the active range

Very low near peg

Impermanent Loss Profile

Variable, depends on weights & correlation

Highest for volatile, uncorrelated assets

Concentrated within range; zero outside

Minimal for tightly correlated assets

Liquidity Concentration

Uniform across entire price curve

Uniform across (0, ∞) price range

LPs choose a specific price range

Concentrated around the 1:1 peg

Oracle Functionality

Built-in geometric mean TWAP

Requires external oracle for TWAP

Built-in TWAP from active ticks

Limited; primarily for peg maintenance

Typical Swap Fee

0.1% - 0.3%

0.3%

0.01% - 1% (configurable)

0.01% - 0.04%

Number of Assets in Pool

n ≥ 2 (generalized)

2 (pair)

2 (pair)

≥ 2 (often 2-4)

use-cases
GEOMETRIC MEAN MARKET MAKER (G3M)

Primary Use Cases and Pool Designs

Geometric Mean Market Makers (G3Ms) are a class of automated market makers (AMMs) defined by a constant product invariant generalized to n assets. Their design enables specialized liquidity pools beyond simple token pairs.

01

The Core Invariant

A G3M maintains liquidity according to the formula ∏ x_i^{w_i} = k, where x_i is the reserve of asset i and w_i is its normalized weight (∑ w_i = 1). This generalizes the Constant Product Market Maker (CPMM) formula (x * y = k) to support multiple assets with customizable weights, enabling complex, multi-asset pools.

03

Concentrated Liquidity (CL)

Modern G3Ms integrate concentrated liquidity, allowing liquidity providers (LPs) to allocate capital within specific price ranges. This dramatically increases capital efficiency compared to full-range liquidity. Protocols like Balancer V2 and Uniswap V3 (for 2-asset pools) use this to offer customizable liquidity curves, where the invariant effectively becomes active only within the chosen price bounds.

04

Stable & MetaStable Pools

G3Ms excel for stablecoin and correlated asset pairs. By setting weights appropriately and using a variant of the invariant (like the StableSwap curve, which blends constant sum and constant product), they create pools with an extremely flat price curve near parity. This minimizes slippage for large trades of pegged assets, making them essential for efficient stablecoin swaps and yield-bearing vault compositions.

05

Liquidity Bootstrapping Pools (LBPs)

A key application is the Liquidity Bootstrapping Pool, used for fair token distribution and price discovery. An LBP typically starts with a high weight on the new token (e.g., 98%) and a low weight on the stablecoin (2%). The weights automatically adjust over time, creating a descending price auction that mitigates front-running and bots, allowing the market to find a price organically.

06

Managed & Investment Pools

G3Ms enable managed pools where a smart contract or a designated manager can rebalance the pool's composition and weights without requiring LP withdrawals. This creates on-chain, composable vehicles for:

  • Tokenized index funds
  • Automated portfolio strategies
  • Rebalancing yield-bearing asset baskets LPs provide liquidity to a dynamic strategy rather than a static set of assets.
security-considerations
GEOMETRIC MEAN MARKET MAKER (G3M)

Security and Economic Considerations

A Geometric Mean Market Maker (G3M) is an automated market maker (AMM) whose pricing curve is defined by the weighted geometric mean of its reserve balances, enabling multi-asset pools and concentrated liquidity. This section details its core mechanisms and trade-offs.

01

Pricing Curve & Impermanent Loss

The G3M uses the formula ∏ R_i^{w_i} = k, where R_i are reserves and w_i are weights summing to 1. This creates a constant product curve for two equal-weighted assets but allows for more complex, flatter curves with multiple assets. While more capital efficient for correlated assets, it is still subject to divergence loss (impermanent loss) when asset prices diverge, with the loss profile shaped by the chosen weights.

02

Multi-Asset Pool Design

A key innovation of G3Ms is native support for pools with three or more assets (e.g., a stablecoin tri-pool of USDC, USDT, DAI). This eliminates the need for routing through multiple 2-asset pools, reducing slippage for complex trades. The weights (w_i) for each asset can be tuned to reflect desired pool composition, such as giving a higher weight to a primary base asset like ETH in a Balancer V2 pool.

03

Concentrated Liquidity & Capital Efficiency

By allowing liquidity providers to set custom weightings and price ranges, G3Ms enable concentrated liquidity. This means capital is allocated only to specific price intervals where it is most likely to be traded, dramatically increasing capital efficiency compared to full-range liquidity. This is the foundational model for platforms like Uniswap V3, which uses a G3M curve where liquidity is concentrated between an upper and lower tick.

04

Oracle Security & Manipulation Resistance

G3Ms, like other constant function market makers, can provide on-chain price oracles. The time-weighted average price (TWAP) is derived from the cumulative price on the pool contract. Security considerations include:

  • Oracle latency: Longer TWAP periods increase resistance to short-term price manipulation.
  • Liquidity depth: A pool with low liquidity is more vulnerable to oracle manipulation via flash loans or large swaps, impacting integrated protocols.
05

Fee Structure & LP Returns

Liquidity provider returns are a function of trading fees and impermanent loss. Key economic factors:

  • Dynamic Fees: Some G3M implementations adjust fees based on volatility or pool utilization.
  • Weighted Ownership: LP shares are proportional to the geometric mean of deposited assets, meaning portfolio rebalancing is inherent to the pool mechanics.
  • Competitive Yield: Returns must compensate LPs for incurred divergence risk, capital lock-up, and gas costs for active management in concentrated pools.
06

Composability & Systemic Risk

As a core DeFi primitive, G3Ms are highly composable, serving as liquidity backbones for lending protocols, derivative platforms, and aggregators. This creates systemic interconnections:

  • A vulnerability or economic failure in a major G3M pool (e.g., a stablecoin de-peg) can cascade.
  • Smart contract risk in the AMM code is a critical attack vector.
  • Reliance on G3M oracles by other protocols compounds the impact of any price manipulation.
GEOMETRIC MEAN MARKET MAKER (G3M)

Common Misconceptions

Clarifying frequent misunderstandings about the mechanics, risks, and applications of Geometric Mean Market Makers, a foundational automated market maker (AMM) design.

A Geometric Mean Market Maker (G3M) is an automated market maker (AMM) whose liquidity pool maintains a constant product of its reserve balances, defined by the invariant x * y = k. This formula, where x and y are the quantities of two assets and k is a constant, determines all pricing and swap execution. When a trader swaps asset X for asset Y, they deposit Δx into the pool, causing the invariant to adjust to (x + Δx) * (y - Δy) = k, and the protocol calculates and delivers Δy to the trader. The marginal price of an asset is given by the ratio of the reserves, and this price changes with every trade, creating slippage. This model, pioneered by Uniswap V2, is the most common type of Constant Function Market Maker (CFMM).

GEOMETRIC MEAN MARKET MAKER (G3M)

Frequently Asked Questions (FAQ)

Common questions about Geometric Mean Market Makers, a type of Automated Market Maker (AMM) that uses a generalized constant product formula for multi-asset pools.

A Geometric Mean Market Maker (G3M) is a type of Automated Market Maker (AMM) where the reserves of multiple assets in a liquidity pool are bound by the invariant that their weighted geometric mean is constant. Unlike the simple constant product formula (x * y = k) used by Uniswap V2 for two assets, a G3M generalizes this to Π (R_i)^{w_i} = k, where R_i is the reserve of asset i and w_i is its normalized weight, allowing for pools with three or more assets and customizable weightings. This model, pioneered by Balancer V1, enables more complex and capital-efficient liquidity pools where the relative prices of all assets in the pool adjust according to trades to maintain this invariant.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team