> LS-LMSR Deep Dive
LS-LMSR Deep Dive
A reference on the Liquidity-Sensitive Logarithmic Market Scoring Rule β the AMM math that underlies most non-CLOB prediction markets β with concrete application to bot-strategy work.
Academic foundation
Origins
The Logarithmic Market Scoring Rule (LMSR) was invented by Robin Hanson in his 2003 paper "Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation." The LS-LMSR extension was developed by Abraham Othman and Tuomas Sandholm at CMU in 2010.
Key papers:
- Hanson (2003, 2007) β original LMSR formulation.
- Othman & Sandholm (2010) β "A Practical Liquidity-Sensitive Automated Market Maker."
Design goals
LMSR addresses fundamental prediction-market challenges:
- Bounded loss β market maker has provably limited worst-case exposure.
- Continuous liquidity β guaranteed ability to trade without counterparty matching.
- Proper scoring β prices converge to true probabilities under rational trading.
- Low-liquidity operation β functions effectively even with minimal trading activity.
Core mathematical formulas
Cost function
The foundational LMSR equation tracks cumulative trading state:
C(qβ) = b Β· ln( Ξ£α΅’βββΏ exp(qα΅’ / b) )
Where:
C(qβ)β total cost function (cumulative subsidy paid out)bβ liquidity parameter (controls market depth / sensitivity)qββ vector of net shares sold for each outcomeqα΅’β shares outstanding for outcomeinβ total number of outcomes
Marginal price (probability)
The instantaneous price for outcome i is the partial derivative of the cost function:
pα΅’(qβ) = βC/βqα΅’ = exp(qα΅’ / b) / Ξ£β±ΌβββΏ exp(qβ±Ό / b)
Properties:
pα΅’ β (0, 1)β always strictly between 0 and 1.Ξ£α΅’ pα΅’ = 1β prices sum to unity (interpreted as probabilities).- It's a softmax over outstanding shares.
Trade cost
When buying Ξ shares of outcome k:
TradeCost = C(qβ + ΞΒ·eβ) β C(qβ)
Where eβ is a unit vector (1 in position k, 0 elsewhere).
Cost is path-independent β only current state and final state matter. Larger Ξ causes increasing marginal price (slippage).
Worst-case loss bound
Maximum market-maker subsidy required per market:
MaxLoss β€ b Β· ln(n)
Implications:
- Loss is bounded and known at market creation.
- Required funding:
F = b Β· ln(n)collateral. - Inverted:
b = F / ln(n).
LS-LMSR extensions
Adaptive liquidity parameter
The key innovation of LS-LMSR is making b dynamic:
b = Ξ± Β· Q
Where Ξ± is a sensitivity parameter set at market creation, and Q is the total trading depth / cumulative liquidity in the market. b grows automatically as trading volume increases.
Liquidity-scaling behaviour
Early market (low Q):
- Small
bβ sensitive prices. - Small trades create large price movements.
- Rewards early conviction and signal revelation.
- Higher slippage on trades.
Mature market (high Q):
- Large
bβ deep liquidity pool. - Prices become "sticky" and smooth.
- Large trades execute with minimal slippage.
- Self-adjusting depth without manual intervention.
Key properties
- Positive homogeneity β prices depend only on share ratios, not absolute quantities.
- Unbounded maximum loss β unlike fixed-
bLMSR, max loss grows with activity. - Liquidity contribution β traders automatically deepen the pool by trading.
- No manual rebalancing β liquidity adjusts organically.
Precog v7 implementation
Parameter calculation
From the Precog v7 contracts, the implementation uses:
alpha = (overround / 10000) / (n * ln(n))
beta = totalShares * alpha
Where:
overroundβ basis points above 100% (creates house edge)nβtotalOutcomesin the markettotalSharesβ cumulative shares across all outcomesbetacorresponds to thebparameter in academic literature
Cost-function implementation
cost = beta * ln( sum( exp(shares[i] / beta) ) )
Direct implementation of C(qβ) = b Β· ln(Ξ£ exp(qα΅’ / b)).
Pricing
buyPrice = cost_after_purchase β current_cost
sellPrice = current_cost β cost_after_sale β 0.001% dust_fee
Liquidity sensitivity (the load-bearing detail)
beta is recalculated on every trade based on totalShares:
- Each trade increases
totalShares. - That automatically increases
beta. - Higher
betaβ deeper liquidity for subsequent trades. - A positive feedback loop: more trading = better liquidity.
Overround mechanism
The overround parameter creates market-maker profit:
- Set in basis points (e.g., 200 = 2% overround).
- Adjusts
alphaso the sum of implied probabilities exceeds 100%. - Example: YES + NO might sum to 102% instead of 100%.
- That spread is the market-maker's revenue source.
Market-making strategies
Arbitrage opportunities
1. Same-market rebalancing
YES + NO prices not summing to $1.00 in the same market.
- YES at $0.52, NO at $0.46 β total $0.98.
- Buy both for $0.98 β guaranteed $1.00 at resolution = ~2% return.
Reality: these windows close in roughly 200 milliseconds due to bot competition. Retail rarely captures them.
2. Combinatorial arbitrage (cross-market)
Logical inconsistencies between related markets.
- "Trump wins presidency" β 55% probability.
- "Republican wins presidency" β 50% probability.
- Logical impossibility: Trump winning implies Republican win.
- Strategy: long Trump, short Republican-party-win.
Documented profits: roughly $40M extracted from Polymarket between April 2024 and April 2025 via combinatorial arb across linked markets.
3. Cross-platform arbitrage
Profit = $1.00 β (Yes_Price_Platform_A + No_Price_Platform_B) β Total_Fees
Typical fees:
- Polymarket β ~2%
- Kalshi β up to 3%
- Minimum viable spread: ~6% for reliable profit.
Polymarket leads price discovery; Kalshi typically lags by minutes β that's the exploit window.
Optimal bid-ask spread
In traditional market making, spread depends on:
- Price volatility (Ο) β higher volatility β wider spread.
- Order-flow volatility β unpredictable trading β wider spread.
- Inventory position β larger net position β wider spread to hedge.
- Capital costs β higher inventory holding costs β wider spread.
In LMSR, spread is implicit in the convex cost function β it's not manually set, it emerges from b. Higher b β tighter implicit spreads (more liquid market). Lower b β wider implicit spreads (more sensitive pricing).
Strategy: early-market entry
Low Q β low b β high sensitivity β large price movements from small trades.
- Enter early when liquidity is thin.
- Establish position at favourable prices.
- As market matures and
Qgrows,bincreases. - Exit at tighter spreads in the deeper market.
- Capture the liquidity premium.
Risk: market may not attract sufficient volume β stuck in an illiquid position.
Strategy: slippage arbitrage
LMSR displays marginal price, but trades execute at average price.
Displayed_Price = p(qβ) // instantaneous marginal price
Execution_Price = ΞC / Ξq // average price over trade size
Slippage = Execution_Price β Displayed_Price
Strategy:
- Identify markets where external probability estimates differ from LMSR price.
- Calculate optimal trade size accounting for slippage.
- Execute when
true_probability β execution_price β fees > 0.
Strategy: overround exploitation
In Precog v7, the overround creates a guaranteed spread:
- If overround = 200 bps, sum of probabilities β 102%.
- The market-maker always quotes above fair value.
- Counter-strategy: only trade when your information edge > overround spread.
- Use external data (polls, prediction models) to identify mispriced markets.
Edge cases and failure modes
Prices near 0 or 1
Pushing price toward extremes becomes exponentially expensive. Required shares grow as:
Ξq β b Β· ln( p / (1 β p) )
As p β 1, ln(p / (1 β p)) β β, requiring infinite shares.
Practical implications:
- Don't chase extreme prices β capital-inefficient.
- Markets near 0 or 1 have poor liquidity and high slippage.
- Manipulation resistance β moving price from 95% β 99% is prohibitively expensive (this is a feature, not a bug).
- CDA (Continuous Double Auction) outperforms LMSR for extreme probabilities.
Low-liquidity markets
- Small
Qβ smallbβ high price sensitivity. - Large percentage moves from small trades.
- Wide implicit bid-ask spreads.
- "Light and sensitive" β good for price discovery, bad for execution.
- Death spiral risk: high costs β low volume β stays illiquid.
Bot strategy: avoid providing liquidity in chronically low-Q markets. Focus on markets with catalysts (upcoming events, news). Size positions small to avoid moving price excessively.
Large trades moving the market
Convexity impact on a binary YES/NO:
- First share costs β current price.
- Last share costs > current price.
- Average cost increases with trade size.
- This is "pure price impact" β not fees, but AMM mechanics.
Bot implications:
- Split large orders β break into smaller chunks to reduce slippage.
- Calculate breakeven β slippage must be less than your information edge.
- Monitor
bβ higher-bmarkets can absorb larger trades.
Resolution edge cases
Deep, balanced markets often resolve at slightly above $1.00 per winning share β slippage and spreads get redistributed to winners at settlement.
Thin, lopsided markets may resolve slightly below $1.00 per winning share β market-maker subsidy was insufficient to cover extreme positions.
Precog v7 mitigates this via overround β revenue pool β backs payouts.
LMSR vs constant-product AMMs
| Feature | LMSR | Constant Product (Uniswap-style) |
|---------|------|-----------------------------------|
| Cost function | C = b Β· ln(Ξ£ exp(qα΅’ / b)) | C = k^(1/n) Β· Ξ£ xα΅’, with Ξ xα΅’ = k |
| Pricing | Softmax: p = exp(q / b) / Ξ£ exp | Ratio: p = y / x |
| Invariant | None (subsidized) | x Β· y = k |
| Math complexity | High (exp, ln) | Low (multiplication) |
| Dynamic funding | Difficult | Easy (LP tokens) |
Subsidy model
LMSR β subsidized; market maker commits capital upfront. Bounded maximum loss b Β· ln(n). Cannot easily crowdfund liquidity dynamically. Use case: prediction markets where bootstrapping liquidity is hard.
Constant product β unsubsidized; LPs provide both sides. No theoretical loss bound (impermanent loss instead). Easily crowdfunded via LP tokens. Use case: asset swaps with two-sided markets.
Coherence across outcomes
LMSR β automatic coherence. Probabilities always sum to 100%. Buying YES automatically adjusts NO price downward. Single liquidity pool per market. No arbitrage opportunities within the same market (assuming no overround).
Constant product β no inherent coherence if multiple pools exist. YES and NO could have separate pools with incoherent pricing. Relies on arbitrageurs to maintain coherence. Can have temporary sum β 100%.
Multi-outcome suitability
LMSR is native multi-outcome β single formula scales to n outcomes, all priced jointly. Constant-product is binary by nature; extending to n outcomes requires multi-token pools (Balancer-style) and is less elegant for 5+ outcomes.
Bot-strategy implications
When to provide liquidity
β
Market has upcoming catalyst (event, news).
β
Current Q is growing β sign of increasing activity.
β
Your information edge > overround spread.
β
Price is near 50% β most liquid region of the curve.
β Chronically low Q with no catalyst.
β Price near extremes (0% or 99%).
β Overround too high relative to your edge.
β High competition (arb opportunities close in milliseconds).
Position sizing
Given:
p_currentβ current market pricep_fairβ your estimated fair probabilitybβ current liquidity parameterfeeβ overround + platform fees
Optimal trade size (binary outcome):
Ξq = b Β· ln( ( p_fair Β· (1 β p_current) ) / ( (1 β p_fair) Β· p_current ) )
Profit check:
Expected_profit = (p_fair β execution_price) Β· Ξq β fees
Only trade if Expected_profit > 0 accounting for slippage.
Slippage management
Pre-trade calculation:
def calculate_slippage(current_shares, trade_size, beta, outcome):
"""Returns execution price and slippage for a trade."""
current_cost = beta * ln(sum(exp(q / beta) for q in current_shares))
new_shares = current_shares.copy()
new_shares[outcome] += trade_size
new_cost = beta * ln(sum(exp(q / beta) for q in new_shares))
trade_cost = new_cost - current_cost
avg_price = trade_cost / trade_size
marginal_price = (
exp(current_shares[outcome] / beta)
/ sum(exp(q / beta) for q in current_shares)
)
slippage = avg_price - marginal_price
return avg_price, slippage
Strategy: for large positions, split across multiple trades; monitor beta growth between trades; wait for opposing trades to increase Q and deepen liquidity.
Risk management
Max_position = kelly_fraction Β· bankroll Β· edge / odds
- Don't concentrate in a single market.
- Spread across uncorrelated events.
- Account for correlation (e.g., election markets).
Stop-loss triggers:
- Market-maker subsidy depleted (rare but catastrophic).
Qdeclining rapidly β liquidity drying up β exit.- Price moves against you beyond statistical confidence.
Arbitrage-bot architecture
- Price monitor β track LMSR markets and external data sources.
- Spread calculator β compute overround and implicit bid-ask.
- Opportunity detector β find
fair_price β execution_price > threshold. - Slicer β break large trades into optimal chunks.
- Executor β submit trades atomically (prevent front-running).
- Risk monitor β track exposure, correlations, worst-case loss.
Latency requirements:
- Same-market arb β under 200 ms (extremely competitive).
- Cross-market arb β under 5 seconds (more viable).
- Information-based β minutes to hours (most accessible for retail).
Connection points
- This is the AMM-side companion to Polymarket CLOB Deep Dive β Polymarket itself uses an order book, not LMSR, but most of the other prediction-market venues you'd cross-arb against do, and the slippage / position-sizing math here applies to any LMSR-based venue.
- The arbitrage architecture sketched in the last section is the design behind polycli's
arbsubcommands.
Sources
Academic
- Hanson, R. (2003). Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation. PDF
- Othman, A. & Sandholm, T. (2010). A Practical Liquidity-Sensitive Automated Market Maker. PDF
Technical
- LMSR primer (Gnosis docs)
- LMSR guide (Gensyn blog)
- Liquidity, pricing and the LS-LMSR (XO Market)
- Cultivate Labs LMSR guide