Constant Sum Market Maker (CSMM)

An AMM where prices never move, which invites arbitrageurs to drain one side completely.

Basically

A constant sum market maker is an automated trading pool where the combined amount of two tokens stays fixed. Every trade uses the same exchange rate, but one token can run out completely.

Key Takeaways

  • A constant sum market maker uses the invariant x + y = k, producing a linear price curve with zero slippage regardless of trade size.
  • Pure CSMMs are impractical for open markets because arbitrageurs can drain the entire pool when the external price diverges from the pool's fixed exchange rate.
  • Hybrid designs such as StableSwap blend constant-sum and constant-product curves to provide low slippage near the peg while preventing total reserve depletion.

What Is a Constant Sum Market Maker?

A constant sum market maker (CSMM) is a constant function market maker that uses x + y = k to determine token prices. The variables x and y represent the reserve quantities of two tokens in a liquidity pool, and k is a constant set when liquidity is first deposited. The constant k changes only when a liquidity provider adds tokens to or removes them from the pool.

The linear relationship between reserves fixes the exchange rate between the two tokens at 1:1. Each unit of token X you swap returns exactly one unit of token Y, regardless of trade size. CSMMs are therefore the simplest automated market makers in concept, but also the most fragile in practice.

The CSMM model serves mainly as a theoretical building block and a component of hybrid curve designs. No major decentralised exchange uses a pure CSMM for open trading because of the depletion risk described below.

How It Works

The constant sum invariant forms a straight line when token X reserves are on one axis and token Y reserves are on the other. Every valid pool state lies somewhere on this line, from (0, k) at one extreme to (k, 0) at the other.

The Linear Price Curve

A constant-product AMM (x · y = k) changes each token's price with every trade because its curve is a hyperbola. Larger trades move the price more and create slippage. A CSMM instead has a straight-line curve with a slope of -1:

The fixed exchange rate means every unit of token X returns exactly one unit of token Y. Trades have no price impact or slippage, and you gain no advantage by splitting a trade into smaller pieces.

Reserve Boundaries

The linear invariant sets hard boundaries for the pool. Each token's reserves range from 0 to k:

The CSMM curve actually reaches zero, unlike a constant-product curve, which approaches zero asymptotically without reaching it. One sufficiently large trade can completely drain one side of the pool.

The Depletion Problem

A pure CSMM cannot adjust its price to market conditions, which is its fundamental flaw. Arbitrageurs will buy all the underpriced token X from the pool and pay with the less valuable token Y if token X's external market price rises above the pool's fixed 1:1 rate. One arbitrageur can drain the entire reserve of the more valuable token in a single transaction because no price curve pushes back.

A pool with 1,000 USDC and 1,000 USDT has k = 2,000. An arbitrageur can deposit 1,000 USDT worth $980 and withdraw all 1,000 USDC worth $1,000 if USDT trades at $0.98 externally while the CSMM still prices them 1:1, capturing $20 in risk-free profit. The pool then holds 2,000 USDT and 0 USDC, leaving it completely depleted on one side and unable to function as a two-sided market.

A constant-product pool works differently: each successive unit of the scarce token costs exponentially more. Full depletion is therefore mathematically impossible.

Hybrid Approaches

Protocol designers use constant-sum curves as one component of hybrid curves because pure CSMMs fail under real market conditions. These hybrids blend constant-sum and constant-product behaviour.

StableSwap (Curve Finance)

StableSwap, introduced by Michael Egorov in November 2019 for Curve Finance, is the most successful hybrid. Its amplification coefficient (A) blends the constant-sum and constant-product invariants into a single curve:

The hybrid design makes StableSwap pools effective for trading between stablecoins and other pegged assets. You get minimal slippage under normal conditions, while liquidity providers stay protected from total depletion during depeg events.

Other Hybrid Designs

Several other approaches use hybrid designs. These designs incorporate constant-sum segments:

Use Cases

The constant sum model is impractical in pure form. Specific applications can still use it where depletion risk is managed or irrelevant:

Why It Matters

The constant sum model explains why different AMM designs exist. It represents one extreme of the design space: perfect execution quality with zero slippage, but zero resilience to price deviations. The constant-product model represents the other extreme: guaranteed liquidity at all prices, with slippage that grows with trade size.

Every modern AMM design sits at a point on this spectrum. StableSwap pools sit close to the constant-sum end for pegged assets, while Uniswap v3's concentrated liquidity lets providers choose their own position on the curve. The Uniswap v4 hooks and DeFi payments research article offers a deeper comparison of these market structures.

Builders integrating token swaps into Bitcoin-native applications must weigh slippage, depletion risk and capital efficiency because these trade-offs directly influence the choice of curve model. Protocols building on layers like Spark can assess whether pegged-asset swaps, which favour constant-sum behaviour, or volatile-pair trading, which favours constant-product behaviour, better serves their users.

Total Reserve Depletion

Total reserve depletion is the defining risk of a pure CSMM. A CSMM has no price cushion, unlike constant-product pools where depletion is asymptotically impossible, so one large trade can extract every unit of the more valuable token and leave liquidity providers holding only the less valuable asset.

No Price Discovery

A CSMM performs no price discovery and fixes its exchange rate at 1:1 regardless of supply, demand or external market conditions. The pool cannot adapt to new information and always trades at a stale price when the true market rate shifts.

Impermanent Loss Becomes Permanent

Impermanent loss in a constant-product AMM is bounded and partially reverses if prices return to their original ratio. Arbitrageurs who drain one side of a CSMM cause liquidity providers to lose their entire position in the depleted token. No recovery mechanism exists, so the loss becomes permanent.

Dependence on External Price Stability

Constant-sum logic assumes that the traded assets will maintain their pegged ratio in any deployment. A broken assumption, such as a stablecoin depeg, can expose liquidity providers to significant losses even in hybrid designs with constant-sum components as the pool absorbs the depegging asset.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.

0

← All 1876 glossary terms