#Definition
The Logarithmic Market Scoring Rule (LMSR) is the foundational algorithm for automated market making in prediction markets. Invented by economist Robin Hanson in the early 2000s, it provides a mechanism for a central "market maker" to always offer a price to buy or sell shares, ensuring liquidity even when there are no other traders.
Unlike order book systems that require two parties for each trade, LMSR acts as a permanent counterparty that algorithmically sets prices based on a cost function. As traders buy shares of an outcome, that outcome's price automatically rises while other outcomes fall—all while keeping probabilities summing to 100%.
#Historical Background
Robin Hanson, an economist at George Mason University, pioneered prediction markets starting with the first internal corporate prediction market at Xanadu in 1990. He developed LMSR in his early 2000s research, publishing the seminal paper "Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation."
Early Adopters:
- Microsoft Research (implemented by Todd Proebsting for internal markets)
- InklingMarkets
- Net Exchange
- Consensus Point (where Hanson served as Chief Scientist)
- Gnosis (blockchain implementation)
LMSR became the "de facto standard for subsidized prediction markets" and laid the intellectual groundwork for the constant function market makers (CFMMs) that power modern DeFi.
#Why It Matters
-
Guaranteed Liquidity: Before LMSR, prediction markets relied on continuous double auction (CDA) order books, which suffered from the "chicken and egg" problem. LMSR solved this by requiring only one trader to execute a transaction.
-
Bounded Loss: The algorithm guarantees that the market maker's maximum possible loss is mathematically capped at where is the number of outcomes. This made it safe for companies and researchers to subsidize markets with known budgets.
-
Foundation of AMMs: LMSR paved the way for modern Automated Market Makers (AMMs) like Uniswap's CPMM, proving that algorithmic market making could work at scale.
#How It Works
#The Cost Function
The total cost to holding a set of share quantities is:
Where:
- : The number of shares outstanding for outcome
- : The "liquidity parameter" which controls price sensitivity
#Price Calculation
The instantaneous price of outcome is the derivative of the cost function:
This formula ensures that probabilities always sum to 100%.
#Visualizing LMSR Price Impact
#Python: Calculating LMSR Costs
import math
def lmsr_cost(q_yes, q_no, b):
"""
Calculates total cost C for a given state of (q_yes, q_no).
"""
return b * math.log(math.exp(q_yes / b) + math.exp(q_no / b))
def calculate_trade_cost(current_yes, current_no, b, buy_amount):
"""
Cost to buy 'buy_amount' of YES shares is:
C(new) - C(old)
"""
cost_before = lmsr_cost(current_yes, current_no, b)
cost_after = lmsr_cost(current_yes + buy_amount, current_no, b)
return cost_after - cost_before
def current_price(q_target, q_other, b):
numerator = math.exp(q_target / b)
denominator = math.exp(q_target / b) + math.exp(q_other / b)
return numerator / denominator
# Example
b = 100
q_yes, q_no = 0, 0 # Market start
price = current_price(q_yes, q_no, b)
print(f"Initial Price: {price:.2f}")
cost = calculate_trade_cost(0, 0, b, 10)
print(f"Cost to buy 10 shares: ${cost:.2f}")
# Notice cost > 10 * 0.50 because price slips upward as you buy
#LMSR vs. Other Market Makers
| Feature | LMSR | CPMM (Uniswap-style) | Order Book (CDA) |
|---|---|---|---|
| Liquidity | Infinite (always a price) | Infinite | Finite (can empty) |
| Traders Required | 1 | 1 | 2 minimum |
| Price Slippage | Logarithmic | Hyperbolic (xy=k) | Step-wise |
| Max Loss | Capped at | Unbounded (IL risk) | None (passive) |
| Parameter Tuning | Requires setting | Pool ratio auto-adjusts | None needed |
| LP Injection | Not supported | Supported | N/A |
| Best For | Subsidized corporate/research markets | DeFi/blockchain markets | High-frequency trading |
#Key Trade-offs
LMSR Advantages:
- Predictable maximum loss makes budgeting easy
- Prevents excessive price fluctuations via logarithmic curve
- Works well with few traders
LMSR Limitations:
- Requires manual parameter selection
- No mechanism for external liquidity providers to add capital
- Less suited for decentralized, permissionless environments
The Liquidity-Sensitive LMSR (LS-LMSR) variant addresses some limitations by adjusting the liquidity parameter dynamically, but still lacks the ability for users to inject their own liquidity—a key feature of modern DeFi AMMs.
#Modern Successors
In 2024, Paradigm proposed pm-AMM, an AMM optimized specifically for prediction market tokens. It concentrates liquidity around 50% probability (where most trading occurs) and reduces liquidity at extreme prices, minimizing "loss-versus-rebalancing" (LVR) for liquidity providers.
#Examples
Corporate Prediction Market: A tech company runs an internal market on "Will we ship Feature X by Q2?" using LMSR with .
- Employee A (engineer on the project) buys 50 YES shares → price rises from 0.62
- Employee B (manager with different information) sells 20 YES shares → price settles at $0.57
- Maximum company subsidy risk: 69.31
- The aggregated price signal (57%) informs executive planning
Academic Research Market: A university runs prediction markets on replication studies. LMSR allows professors to subsidize markets for $50-100 each, creating liquidity for students to bet on whether famous psychology experiments will replicate.
#Risks and Limitations
-
Parameter Sensitivity: If is too low, large orders face massive slippage. If too high, prices barely move and information aggregation is slow.
-
Subsidy Requirement: The market maker systematically loses money to informed traders—this is the "cost of information extraction." LMSR markets require upfront funding.
-
No Organic Revenue: Unlike fee-based AMMs, pure LMSR markets don't generate revenue to offset losses, making them unsuitable for commercial platforms without subsidies.
-
Combinatorial Explosion: For markets with many correlated outcomes, the state space grows exponentially, making full LMSR computationally expensive.