logo

Constant Function Market Maker (CFMM): What It Is and How It Works

Constant Function Market Maker (CFMM): What It Is and How It Works
260

A Constant Function Market Maker (CFMM) is a type of Automated Market Maker (AMM) that uses a constant mathematical function to turn liquidity reserves into tradable prices. Instead of waiting for a buyer and a seller to meet at the same price, the pool accepts trades against a curve. That curve defines the marginal price, price impact, and slippage.

In prediction markets, the concept matters because every market structure has to answer the same question: how can trading happen when there is no immediate counterparty? An order book solves that with orders from other traders. An automated market maker solves it with a pricing rule. A CFMM is one version of that rule.

This guide explains what a CFMM is, how the constant function works, where the model helps, and where it fails. It also compares CFMMs with LMSR, CLOBs, and hybrid models. > Educational content only. This is not investment advice, trading advice, or a recommendation to use any specific platform.

What Is a Constant Function Market Maker (CFMM)?

A Constant Function Market Maker is an AMM that keeps a function constant over the reserves of a pool. When someone trades, the reserves change. To preserve the function, the price changes too. The pool itself provides liquidity and calculates prices without requiring a direct counterparty.

The idea became widely known through decentralized exchanges, but it is not limited to DeFi. It belongs to a broader family of automated price-formation mechanisms. That makes it useful for understanding prediction market microstructure.

Definition in One Sentence

A CFMM is an automated market maker where a fixed curve links liquidity, reserves, marginal price, and execution cost.

The word “constant” does not mean the price is constant. It means the function must remain valid after every trade. The trader changes the pool quantities. The algorithm adjusts the price to maintain the invariant.

Why the “Constant Function” Matters

The constant function is the economic contract of the pool. It determines how much a trader must deliver to receive another asset, share, or outcome. It also determines how the price reacts to order size.

In the classic example, the function is x * y = k. If x is the reserve on one side and y is the reserve on the other side, their product must remain equal to k. A purchase that reduces y must increase x enough to preserve the product.

That simple rule creates three important effects:

  1. The price changes after every trade.
  2. Larger orders pay a worse average price.
  3. Deeper pools suffer less price impact.

The curve design is therefore not a technical detail. It defines the trader’s execution experience.

CFMM as a Family of AMMs

AMM is the broad category. CFMM is a subclass. Every CFMM is an AMM, but not every AMM has to be a CFMM.

Inside the CFMM family, there are several curves. The most famous is constant product, which appears in many DeFi examples. There are also constant sum, constant mean, and hybrid curves. Each one distributes risk differently.

Academic literature treats CFMMs as multi-asset trading mechanisms and curve-design problems. The Wikipedia page on CFMMs summarizes the general definition, while Angeris, Chitra, and Boyd go deeper in their paper on Constant Function Market Makers. For a prediction market reader, the practical takeaway is simple: the curve decides how implied probability moves when money enters the market.

How a Constant Function Market Maker Works

A CFMM starts with a liquidity pool. That pool has reserves. In a simplified binary prediction market, those reserves can be connected to YES and NO outcomes. In a decentralized exchange, they would usually be two tokens. In an event market, think of them as two sides of a trade.

Every trade makes the pool receive something and deliver something. After the trade, the function must still be valid. The new price comes from that new state.

Reserves, Liquidity Pool, and Invariant Function

Three concepts support the CFMM model.

Reserves are the balances held by the pool. They represent the liquidity available for execution.

Invariant function is the rule that must remain constant. In a constant-product model, that rule is x * y = k.

Marginal price is the price of the next very small unit. It can be different from the average price of a large order.

That difference between marginal price and average price is central. A trader may see an implied probability of 50%. Even so, a large order may pay a higher average price. That extra cost is slippage.

Simple Example: x*y=k

Imagine a simplified pool with 100 units of YES and 100 units of NO. The function is:

100 * 100 = 10,000

Now imagine a trader buys YES. To keep the example simple, assume the trader removes 10 units of YES from the pool and delivers units of the other side. After the withdrawal, the pool has 90 units of YES. To maintain k = 10,000, the other reserve needs to rise to roughly 111.11.

State YES Reserve NO Reserve Product
Before 100 100 10,000
After 90 111.11 10,000

The more YES leaves the pool, the more expensive the next YES becomes. The curve protects the pool against infinite liquidity consumption at a fixed price.

How an Order Changes Price

In a CFMM, a large order walks along the curve. It does not execute entirely at the first displayed price.

That creates an important distinction:

  • Marginal price: the price of the next fraction traded.
  • Average price: total cost divided by the quantity bought.
  • Slippage: the difference between the expected price and the effective price.

If the pool is shallow, the same order moves the curve more. If the pool is deep, the price changes less. Liquidity is therefore not just a question of whether a market exists. It is also a question of how much price you move to enter or exit.

In prediction markets, this changes interpretation. A 52% probability on the screen does not necessarily mean a large position can enter fully at 52%. Estimated order cost matters.

CFMMs in Prediction Markets

A Constant Function Market Maker in prediction markets should be understood carefully. The model is useful, but it is not synonymous with a prediction market.

Prediction markets can use many mechanisms. Some use order books. Others use automated market makers. Others combine systems. A CFMM is one conceptual option for continuous liquidity, but it is not the only one.

YES/NO Contracts and Implied Probability

A binary market has two main outcomes: YES and NO. In many designs, the price of YES can be read as an implied probability. If YES costs 0.60 in a contract that pays 1.00, the simple reading is 60%.

However, that reading needs context. Fees, spread, depth, resolution rules, and price impact can all change the real execution.

A CFMM helps make that visible. When more traders buy YES, the YES reserve falls relative to the other side. The curve starts charging more for YES. The price rises. The market signals a higher implied probability.

But the price is not an objective truth. It is the result of orders, liquidity, and the mechanism’s rule.

Why Prediction Markets Do Not Always Use Pure CFMMs

Prediction markets have different needs from a typical decentralized exchange.

An event market has final resolution. After the result, one side is worth 1 and the other is worth 0. Events can also have asymmetric information. A new announcement can change probabilities within minutes.

That is why some designs prefer LMSR, which was created for information aggregation. Others prefer a Central Limit Order Book (CLOB), where traders place bids and offers directly. There are also hybrid models that use an order book for efficiency and some form of automated liquidity as support.

The right choice depends on the objective. If the priority is continuous pricing from the start, an AMM helps. If the priority is execution between professional traders, a CLOB may be better. If the priority is information discovery with controlled cost, LMSR can make sense.

AMMs as Liquidity Backstops

An AMM can work as a liquidity backstop. That means it offers execution when the order book is empty or thin.

This role is useful in new markets. At the beginning, few traders want to post limit orders. Without initial liquidity, the market looks dead. An automated market maker can create an initial price and allow the first trades.

That benefit has a cost. If the curve is poorly calibrated, it can create bad prices, easy arbitrage, or losses for liquidity providers. In events with concentrated information, that risk grows.

CFMM vs LMSR vs CLOB

CFMM, LMSR, and CLOB solve the same broad problem through different paths. All of them try to turn information and liquidity into price. The difference is the mechanism.

Mechanism How It Forms Price Best Use Main Tradeoff
CFMM Curve over pool reserves Continuous liquidity and automatic execution Slippage and risk from poor curve calibration
LMSR Scoring rule and cost function Information aggregation in events May require subsidy and careful parameterization
CLOB Limit orders from buyers and sellers Markets with many active traders Can be thin without market makers
Hybrid Combines book, matching, automated liquidity, or on-chain settlement Platforms with mixed requirements More complex to operate and explain

CFMM: Curve and Pool

A CFMM depends on reserves. The price comes from the state of the pool. This gives immediate execution as long as liquidity exists. The advantage is operational simplicity: the trader does not need to wait for someone else to accept the order. The disadvantage is the cost of moving along the curve.

In small markets, that cost can be high. A displayed price should therefore be read together with depth.

LMSR: Scoring Rule and Information Cost

LMSR stands for Logarithmic Market Scoring Rule. It is not just a reserve curve like a classic CFMM. It defines a cost function for buying exposure to outcomes.

The liquidity parameter controls how much the price moves. A larger parameter reduces price impact, but it increases the capital needed to support the market maker.

LMSR appears often in the history of prediction markets because it was designed for information aggregation. It helps create prices even with low participation, but it requires care around subsidies and loss limits.

CLOB: Order Book and Counterparty

CLOB stands for Central Limit Order Book. In this model, traders place buy and sell orders. A trade happens when prices cross.

The advantage is that the market can have tight spreads when there are many participants. The disadvantage is that new markets can have no liquidity. Without orders in the book, there is no good execution.

Polymarket’s documentation describes its CLOB as a decentralized hybrid system. It mentions off-chain matching and on-chain settlement. The documentation also says orders are signed messages and that matched trades settle on Polygon. See the Polymarket technical overview.

Hybrid Models

Hybrid models try to combine advantages. A system can use an order book for active traders and automated liquidity for thin markets, or separate matching, custody, and settlement. This can improve execution, but it increases complexity. For analysis, ask: who is forming the price right now, a curve, a book, a human market maker, or a combination?

Advantages and Limitations of a CFMM

A CFMM is powerful because it makes liquidity programmable. But it does not eliminate risk. It converts risks into mathematical rules.

Continuous Liquidity

The main advantage is continuous liquidity. The trader can execute against the pool without waiting for a direct counterparty.

This helps in small, new, or low-activity markets. It also makes the experience more predictable. There is a clear rule for estimating the cost of a trade.

For a product such as Macro Markets, AMM logic can help prediction markets have dynamic pricing and smoother execution. The pricing rule needs to be transparent so the trader understands the cost before confirming.

Slippage and Price Impact

The main limitation is slippage. The larger the order is relative to the pool, the larger the price impact.

This effect is not a bug. It is part of the design. The curve charges more when an order consumes liquidity on one side.

For the trader, this creates three important readings:

  1. The displayed probability may be only the marginal price.
  2. The average order cost may be worse.
  3. An early exit can also suffer slippage.

Order size and pool depth matter as much as the event thesis.

Risk for Liquidity Providers

Liquidity providers take risk. They provide capital to the pool. In return, they may receive fees or incentives, depending on the design.

The risk appears when the external price changes quickly or when informed traders trade against the curve. In DeFi, this is often called impermanent loss. In prediction markets, the risk can arise when news makes one outcome much more likely while the pool still offers an outdated price.

That risk does not make CFMMs bad. It shows that liquidity has a cost. Someone must carry the risk of quoting prices while the market is uncertain.

Arbitrage and Curve Calibration

Arbitrage can align prices across markets. If one CFMM prices YES at 45% and another liquid market prices it at 55%, traders can buy cheap and sell expensive.

That process corrects prices, but it can be costly for the pool. The curve must be calibrated. Initial liquidity, fees, order limits, and risk parameters matter.

An aggressive curve improves execution for small traders, but exposes the pool. A conservative curve protects the pool, but increases slippage. There is no free lunch in market microstructure.

Polymarket, Kalshi, and CFMM: What Can Be Said Safely?

It is tempting to use well-known names to explain CFMMs. But comparisons need to be precise.

CFMM is a conceptual AMM model. It should not be attributed to a platform without clear documentation. The safe path is to separate what is documented from what is analogy.

Polymarket and the Hybrid CLOB Model

Polymarket documents a hybrid CLOB. According to its official documentation, the system uses off-chain matching and on-chain settlement. That is different from saying the platform uses a CFMM as its main mechanism.

Even so, CFMMs are useful for comparison. They show what changes when price comes from a curve rather than orders in a book.

In a CLOB, price depends on available orders. In a CFMM, price depends on the function and reserves. Both can reveal market expectations, but they do so through different mechanisms.

How to Read CFMM Logic in a Prediction Market

In practice, the trader should look at execution, not just the event thesis. A good question about an event can become a bad trade if the market is shallow.

Use this checklist:

  1. Look at the displayed probability. It shows the current price, but not necessarily your average cost.
  2. Simulate the order size. Larger orders can move the curve.
  3. Compare price before and after. This reveals price impact.
  4. Think about the exit. Entering is only half the trade.
  5. Read the resolution rule. The curve prices the event; it does not resolve it.
  6. Separate liquidity from conviction. Price can move because depth is low, not only because new information arrived.

This discipline prevents a naive reading. A market may show 60%, while your actual execution is different. Microstructure is the bridge between analysis and financial outcome.

FAQ About Constant Function Market Maker (CFMM)

Is CFMM the Same as AMM?

Not exactly. AMM is the broad category of automated market makers. CFMM is a family of AMMs that maintains a constant function over reserves. Every CFMM is an AMM, but not every AMM is a CFMM.

Is CFMM Better Than an Order Book?

It depends on the market. A CFMM offers continuous liquidity and automatic execution. An order book can offer better prices when there are many active traders. In thin markets, the book can be empty. In thin pools, the CFMM can generate high slippage.

What Is Impermanent Loss?

Impermanent loss is the risk that a liquidity provider ends up worse off than if they had simply held the assets outside the pool. In prediction markets, the same idea appears when informed traders move price against passive liquidity.

Can CFMMs Work for Binary Markets?

They can, but they are not always the best choice. Binary markets have final resolution, asymmetric information, and a need for clear liquidity. A CFMM can help as automated liquidity, but LMSR, CLOBs, or hybrid models may also be more appropriate.

Why Does a CFMM Create Slippage?

A CFMM creates slippage because large orders move along the curve. Each unit bought changes the reserves and changes the price of the next unit. The smaller the pool is relative to the order, the larger the price impact tends to be.

Does Polymarket Use a CFMM?

Polymarket’s public documentation describes a hybrid CLOB, with off-chain matching and on-chain settlement. It is therefore not accurate to say that CFMM is Polymarket’s documented main mechanism. CFMM is useful as a conceptual comparison.

Conclusion

A Constant Function Market Maker is essential for understanding how liquidity curves turn reserves into prices. It shows why liquidity, slippage, and price impact are part of the traded probability.

In prediction markets, CFMMs do not replace LMSR, CLOBs, or hybrid models. They provide a lens for comparing mechanisms. Once you understand that lens, you can read the displayed price, the real execution cost, and the hidden risk behind a simple probability more clearly.

Author
Dale Hanson
Dale HansonCommunity Manager. X @InHansonWeTrust