Prediction Markets · Automated Market Making

A visual guide to LMSR.

The Logarithmic Market Scoring Rule is a simple, elegant formula that lets a computer run a prediction market with infinite liquidity, bounded loss, and prices that behave like probabilities. Scroll down to see how — and play with a live market below.

2002Invented by Robin Hanson
b·ln(n)Max loss to the market maker
Liquidity — you can always trade

The problem LMSR solves

Imagine you want to run a market on the question "Will it rain tomorrow?" In a normal order-book market, you need buyers and sellers present at the same time. If nobody's around, the market is dead and prices stop moving.

A market maker fixes this by always standing ready to trade, quoting both a buy and sell price. But a human market maker can lose unlimited money. LMSR is a formula that plays the role of market maker — it is always willing to trade, its prices always add up to 100%, and the worst case loss is known in advance.

Always liquid

There's no order book. A user can buy or sell any quantity at any time — the formula names a price.

🎯

Prices are probabilities

Prices for all outcomes always sum to exactly 1. The market's price for "YES" is the crowd's estimate.

🛡️

Bounded loss

The operator's worst-case loss is a fixed number: b · ln(n). No surprises.

The entire thing in three formulas

LMSR has only a handful of moving parts. Let qi be the total number of shares of outcome i the market has ever sold, and let b be a liquidity constant chosen by the operator.

1 · Cost function
C(q) = b · ln( Σi eqi/b )

The state of the market is a single number: the cost. It only goes up, and the price a trader pays for a trade is simply the change in C.

2 · Price of outcome i
pi = eqi/b / Σj eqj/b

This is just the softmax over q/b. Prices are strictly between 0 and 1, and they always sum to 1 — just like probabilities.

3 · Cost of a trade
cost = C(q + Δq) − C(q)

Want to buy 10 YES shares? The market maker charges you exactly the increase in C. When the market resolves, each winning share pays $1.

Intuition pump

  • The price is the slope. The price of outcome i is the partial derivative of C with respect to qi. Buying a share of YES "costs" roughly the current YES price — and then nudges the price up for the next buyer.
  • Why logarithm? The log + softmax pair is what guarantees prices sum to 1 and that buying outcome A doesn't magically change the ratio between B and C.
  • What is b? Think of it as market depth. A larger b means a trade moves the price less — and also means the operator risks more.

Live binary market simulator

Below is a working LMSR prediction market for the (fictional) question: "Will it rain in Berlin tomorrow?". Buy and sell YES or NO shares, adjust the liquidity parameter, and watch the price and the market maker's profit & loss move in real time.

MARKET
Will it rain in Berlin tomorrow?
CURRENT PRICES
YES
50.0¢
Shares outstanding: 0
NO
50.0¢
Shares outstanding: 0
PRICE HISTORY — implied probability of YES
MAKE A TRADE
Est. cost
Avg price / share
New YES price
Slippage
LIQUIDITY PARAMETER
Higher b → deeper market, smaller price impact, larger max loss.
TRANSACTION FEE (α)
Fees turn noise volume into maker profit — at the cost of path independence.
MARKET MAKER P&L
LMSR revenue
$0.00
Fees collected
$0.00
Max (b·ln 2)
$69.31
Liability YES
$0.00
Liability NO
$0.00
Worst-case P&L
$0.00
Current worst-case loss vs. theoretical maximum
Random retail round-trips. With a fee the maker profits; without, LMSR's path-independence means zero impact.
TRADE LOG
No trades yet. Try buying 20 YES shares.
Try this: Buy 50 YES shares. Watch the YES price jump. Now try to buy another 50 — notice it costs more per share than the first batch. That's automated slippage, baked into the formula.
Try this: Move the b slider. With b=10, even tiny trades rocket the price. With b=500, a 50-share trade barely moves it.
Try this: Drive the YES price to 90%. Now sell some YES. You get paid — the market maker gives you real money back. Selling is how traders realize profits before resolution.

What the liquidity parameter b really does

The operator of an LMSR market picks one number up front: b. It controls a direct trade-off between how easy the market is to move and how much money the operator can lose in the worst case.

Max loss (bln 2)$69.31
Cost to move 50%→60%
Cost to move 50%→80%
Cost to move 50%→95%
Price impact curve: YES price as a function of net YES shares bought (starting from 50/50).

Small b (≈10)

  • Thin market: a handful of shares flips the price dramatically
  • Great for tiny internal markets where no one will trade much
  • Almost nothing at risk for the operator
  • Feels "jumpy" and is easy to manipulate

Large b (≈1000)

  • Deep market: big trades barely move the price
  • Good when you expect lots of volume
  • Operator puts real money on the line as subsidy
  • Slow to react to genuine new information

More than two outcomes

LMSR generalizes naturally to any number of outcomes. The formulas don't change — you just have more qi's in the sum. Here's an election-style market with four candidates.

MARKET — Who will win the election?

Notice how buying one candidate pushes down every other candidate's price proportionally — the whole market stays perfectly consistent. The prices always sum to exactly 100%.

Maker economics — the information-theoretic view

Everything about LMSR's losses boils down to one clean result. If the market starts at prior πinit and the world's true probability is πtrue, and rational traders push the market toward the truth, then the market maker's expected loss is exactly:

𝔼[Loss]  =  b · DKLtrue ‖ πinit) DKL is the Kullback–Leibler divergence — "information gained" in nats.

Read it plainly: the maker pays b dollars per nat of information the crowd reveals. The worst-case bound b·ln(n) is just the KL divergence from a uniform prior to complete certainty — the information-theoretic cost of going from "knowing nothing" to "knowing everything."

BINARY KL CALCULATOR
KL divergence
0.000 nats
Expected loss
$0.00
Worst-case ceiling (b·ln 2)
$69.31
Fraction of ceiling
0%
𝔼[Loss] vs. theoretical max
COMMON SCENARIOS (b = 100, binary market, πinit = 50/50)
πtrueInterpretationKL (nats)𝔼[Loss]
50 / 50Prior already correct — no info flow0.000$0.00
60 / 40Mild signal0.020$2.04
75 / 25Confident lean0.131$13.08
90 / 10Strong signal0.368$36.81
99 /  1Near-certainty0.637$63.72
100 /  0Certain event — theoretical maximum0.693$69.31

Three rules of thumb for operators

  • Expected cost: Budget b · KL(belief ‖ prior). If you think the truth is 80/20 and start at 50/50, you'll pay ≈ 0.19 · b on average.
  • Worst-case capital: Post b · ln(n) as collateral — that's 0.693 · b for binary markets. This is the hard ceiling. You can never lose more.
  • Picking b: Ask yourself: "how much would I pay to get a well-calibrated answer to this question?" That number is b · ln(n). Solve for b.

Noise traders, fees, and path independence

In pure LMSR, noise traders (people trading randomly, for liquidity, or for hedging) don't help the maker at all. Why? Because LMSR is strictly path-independent: buying 10 shares and then selling them back returns the market to its exact original state — including revenue. A round trip costs the trader exactly zero.

That's why real platforms add a small transaction fee α on top of LMSR. With fees, every round-trip leg pays α × |cost|, which accumulates as maker profit. The fee deliberately breaks path-independence — now noise volume actually subsidizes the information-extraction mechanism.

Try it in the simulator: set fee to 2%, then click "Run 50 noise trades" — watch Fees collected grow while the YES price barely moves. Now set fee to 0 and click again. Fees stay at zero no matter how much noise flows through. That's path independence in action.

Bonus round — CPMM, the DeFi alternative

LMSR needs a central operator willing to post b·ln(n) as subsidy. In DeFi that's awkward: there is no operator, just code and capital. The most popular alternative is the Constant Product Market Maker — the same math Uniswap uses, adapted to prediction markets. Instead of an operator paying the bill, any number of liquidity providers (LPs) chip in collateral and earn trading fees. The cost they bear is something called impermanent loss.

1 · Invariant
x · y = k

The pool holds x YES tokens and y NO tokens. Their product stays constant as people trade.

2 · Price of YES
pYES = y / (x + y)

Whichever token is scarce in the pool is the expensive one. If there are 4× as much NO as YES, YES is trading at 80¢.

3 · Trading mechanic
deposit $D → mint YES+NO

Collateral always mints matched YES/NO pairs ($1 = 1 YES + 1 NO). You keep the side you want and swap the other into the pool.

CPMM MARKET
Binary prediction pool (Uniswap-style)
POOL STATE
YES reserves (x)
100.00
NO reserves (y)
100.00
Invariant k = x · y
10,000.00
YES
50.0¢
NO
50.0¢
LP POSITION (single LP, 100% share)
Deposited
$100.00
Current EV
$100.00
Impermanent loss
$0.00
IL as fraction of deposit

LP payout on withdrawal = min(x, y) recovered as collateral + |x − y| tokens of whichever side is left over, valued at current market price. If the market moves away from 50/50, the LP ends up holding directional exposure they didn't want — that gap is impermanent loss.

SIMULATE TRADES
Each button simulates a trader depositing that much collateral. Watch the pool rebalance, the price move, and the LP's impermanent loss grow.

LMSR vs CPMM side by side

PropertyLMSRCPMM
Who provides liquidityCentral operator subsidizesAnyone can deposit as LP
Max lossHard bound: b · ln(n)Unbounded in principle (IL can be arbitrarily bad)
Prices sum to 1?Always, by constructionAlways, by construction
Path independenceYes — round trip is freeYes (without fees)
Liquidity scales with usage?No — b is fixed up frontYes — more LPs = deeper pool
LP revenue sourceN/A (no LPs)Trading fees (typically 0.3–2%)
Information-theoretic interpretationYes — 𝔼[loss] = b · DKLNo clean one
Who bears the cost of informationThe operatorThe LPs (via IL)
Best fitResearch, internal, classroom, subsidizedPermissionless DeFi, scalable on-chain markets

Why LPs suffer impermanent loss in prediction markets

Imagine you deposit $100 at 50/50. Pool is x=100, y=100. Then smart traders push the price to 80% YES — meaning x=50, y=200.

If you withdraw, you get 50 YES + 200 NO. You can redeem 50 complete pairs for $50. You're left holding 150 NO tokens — a directional bet you never wanted. At the current 20¢ market price, those are worth ≈ $30. Your total: $50 + $30 = $80. You deposited $100.

The missing $20 is the payment you (as LP) made to the informed traders who moved the price. In LMSR this is the operator's b · DKL subsidy. In CPMM it's IL, paid by whoever pooled their capital. Same information-theoretic price — different bag-holder.

The downsides nobody puts on the pitch deck

LMSR is clever and widely used, but it is not free lunch. Here are the real costs.

01

The operator must subsidize the market

LMSR is a scoring rule, not a matching engine. The market maker's expected loss is not zero — it pays traders for bringing in information. The b · ln(n) number is a ceiling, not an expectation. Someone has to fund that.

02

Liquidity is fixed at design time

You have to pick b before you know how popular the market will be. Too small and the market is unusable; too large and you burn money on a market nobody trades. Constant-product AMMs (Uniswap-style) at least scale liquidity with deposits — LMSR does not.

03

Fees are zero by default

Plain LMSR has no fee mechanism. Any profit for the operator must come from manually added spreads or transaction fees — which break some of the nice mathematical properties like path-independence.

04

It assumes a fixed set of outcomes

Adding a new outcome mid-market is painful — it changes the geometry and can hand traders arbitrage. Real prediction-market platforms have to plan outcomes carefully up front.

05

Capital-inefficient on-chain

The operator must post collateral equal to the worst-case payout for every open market, all the time. For a platform with thousands of concurrent questions this gets expensive fast. This is why many modern prediction platforms use order books or CPMM variants instead.

06

Vulnerable to small-market manipulation

If b is small (a cheap-to-run market), a well-funded attacker can push the price wherever they like for relatively little money. The price then reflects their wallet, not the crowd's belief.

So when should you use it?

LMSR is the right tool when you want a simple, always-on, probability-valued market for a known set of outcomes, you're willing to subsidize information revelation, and you care more about behavioral clarity than capital efficiency. That's why it shows up in play-money platforms, internal corporate forecasting tools, research experiments, and classroom demonstrations — and why serious on-chain markets usually reach for something else.