Prediction Market LMSR/AMM Automated Market Maker: Pricing, Liquidity, and Risk Architecture from Constant-Rule to Multi-Outcome Events

Prediction MarketInfrastructure٣ أغسطس ٢٠٢٦

Prediction markets (Prediction Market) translate real-world event outcomes into tradable contracts—"the Democratic candidate wins the 2026 US election," "BTC's month-end close is above $120,000," "a certain player scores more than 2.5 goals in this match." Users buy and sell "Yes/No" or multi-outcome shares to price the probability of an event and receive one unit of collateral (typically USDC, USDB, or a platform stablecoin) when the outcome resolves correctly.

The trading mechanism of prediction markets is fundamentally different from that of a spot DEX. A spot DEX trades two assets that each have "independent value," whereas in a prediction market, all outcome shares together sum to exactly one unit of collateral. This means the market maker is not facing a relative price between two asset classes, but a probability distribution whose total is conserved. This fundamental difference gave rise to a dedicated family of pricing functions—LMSR (Logarithmic Market Scoring Rule) and its variants LS-LMSR, constant-product / constant-mean multi-outcome AMMs, and hybrid order-book + AMM models.

For a team that wants to build a prediction market, the choice and implementation of the AMM directly determines three things:

  1. Quality of price discovery: whether prices can converge to the true probability quickly and stably, without being manipulated by a few large orders;
  2. Liquidity and slippage: whether small bets are cheap, large orders are executable, and how efficiently the market-making capital is utilized;
  3. Risk for the platform and LPs: when the event resolves, will the market maker take a loss? How are invalid markets and disputed resolutions handled?

This article starts from the underlying mathematics of prediction markets and systematically reviews LMSR and its variants, the unified model for multi-outcome events, share split and merge, liquidity provision, fees, oracle resolution, risk control and arbitrage bounds. Combined with the practices of mainstream protocols such as Polymarket, Augur, and Manifold, it presents SoonTech's complete design for landing prediction-market AMM solutions. Whether you are a product manager, smart-contract engineer, market maker, or risk-control lead building a prediction market, or a team looking to embed prediction-market capabilities into your own application, after reading this article you will have a complete framework that can be used directly for design and review.

1. The Financial Structure of Prediction Markets

1.1 One Contract = One Complete Set of Outcomes

The core financial structure of a prediction market is the "Complete Set." For an event with N possible outcomes, a user deposits 1 USDC of collateral and can mint N shares—one share of each outcome, so that 1 USDC maps to outcome_0(1) + outcome_1(1) + … + outcome_{N-1}(1). When the event is Resolved, exactly one outcome (or multiple outcomes according to some weighting) is judged the "winner." Each winning share can be redeemed for 1 USDC, and losing shares are worth 0. This means:

  • At any moment, the sum of the prices of all outcome shares is always equal to 1 USDC;
  • The price of each outcome can be interpreted as the market-implied probability;
  • Buying one "Yes" contract is equivalent to paying p USDC, receiving 1 USDC if you win, for a net profit of (1−p) USDC.

This structure differs from Parimutuel (the pool-betting system used in horse racing): under parimutuel, the odds are only determined at the last moment, whereas in a prediction market, prices move continuously and holders can close out at market prices at any time to realize their profit and loss.

1.2 Binary vs. Multi-Outcome

  • Binary market: Yes / No, two outcomes, prices in the [0,1] range, summing to 1. This is the most common form, suited to "will it happen or not" style events.
  • Multi-outcome / Categorical market: N mutually exclusive outcomes, e.g., "who will win the US election" (Democrat, Republican, third party, ...). All outcome prices sum to 1.
  • Scalar market: The outcome is a continuous value (e.g., "BTC month-end close price"), usually decomposed into a series of tranche outcomes, or priced with LMSR on a continuous price.
  • Multi-winner market: More than one outcome can win simultaneously, e.g., "will a certain party win both chambers of Congress" might win two at once. This requires special design—you can no longer simply assume "exactly one winner."

Different forms can be unified mathematically: view the event as an "outcome vector" and assign a redemption weight w_i ∈ [0,1] to each outcome at resolution, with Σ w_i = 1. A binary market has only one w_i = 1; a multi-winner market may have several w_i as fractions.

1.3 Prediction Market vs. Spot DEX

DimensionSpot DEXPrediction MarketCollateral

Both assets have independent value

All outcomes sum to 1 unit of collateral

Price range

Any positive number

[0, 1], with a conserved sum

Expiry

Usually none

Has a defined resolution time

Source of return

Fees, price appreciation

Fees, betting correctly on the probability

Market-maker risk

Unlimited loss (one-sided price movement)

Bounded loss (worst loss = liquidity parameter b)

Oracle

Spot price (for valuation)

Event outcome (determines final redemption)

The most essential difference is in the last row: the worst-case loss of a prediction-market maker is bounded, because there exist two risk-free operations—minting a complete set and redemption—which provide a natural anchor for market making and arbitrage.

2. LMSR: The Standard Pricing Function of Prediction Markets

2.1 Function Definition

LMSR was proposed by Robin Hanson in the early 2000s and is the most widely used market-making formula in prediction markets today. For an event with N outcomes, let q_i be the number of shares of each outcome i. The cost function the market maker uses for pricing is C(q) = b · ln( Σ exp(q_i / b) ), where b is a positive number called the "liquidity parameter." The cost of buying Δq_i shares of outcome i is cost = C(q + Δq_i) − C(q); selling (negative Δq_i) yields the corresponding revenue. The instantaneous (marginal) price of each outcome is p_i = ∂C/∂q_i = exp(q_i/b) / Σ_j exp(q_j/b). You can verify that Σ p_i = 1 and p_i ∈ (0,1), naturally satisfying the probability interpretation.

2.2 The Meaning of the b Parameter

b is the most critical parameter in LMSR. It simultaneously determines two things:

  • Price sensitivity: the larger b is, the flatter the price curve, the smaller the impact on price for the same buy order, and the lower the slippage;
  • The market maker's maximum loss: when all shares have been bought to the extreme (some q_i far larger than the others), the market maker's maximum loss is approximately b·ln(N).

In other words, providing deeper liquidity requires bearing a greater worst-case loss. This is a fundamental tradeoff: b cannot be arbitrarily enlarged; it must match the ceiling of collateral the market maker is willing to commit.

For a standard binary market, to support a price range of 0.01–0.99, the required collateral is approximately b·ln(2). Hence b is also often directly called "funds" or "initial liquidity."

2.3 The Intuitive Behavior of LMSR

  • When all q_i are equal, all p_i are equal (a uniform prior 1/N);
  • Buying an outcome raises its price and suppresses the other outcomes' prices; due to the exponential nature of softmax, prices never truly reach 0 or 1;
  • The cost of buying rises exponentially with the quantity already bought, which naturally suppresses "infinite buying" and prevents the price from being easily pushed to an extreme;
  • Once the LP commits capital and sets b, the market maker quotes automatically based on the formula, with no order book required.

2.4 Advantages and Problems of LMSR

Advantages:

  • Prices always satisfy Σ p_i = 1, and can be directly interpreted as probabilities;
  • Maximum loss is bounded, which is friendly to risk control;
  • Provides infinite liquidity (any size order can be filled, only the price impact increases);
  • The formula is simple and on-chain implementation is acceptable (it needs exp and ln, which can be implemented via lookup tables / math libraries such as ABDK).

Problems:

  • Uneven liquidity distribution: around probability 0.5 and around 0.01, "the sensitivity of price to capital" differs greatly, yet b is a single parameter; this causes the market to be either too shallow at extreme probabilities or to waste capital;
  • Slippage near 0 and 1: when an outcome is already very certain (p = 0.99), even a small buy order can still push the price to 0.995, with asymmetric marginal cost;
  • Fee and LP incentive design: LPs supply capital, but their income comes from fees and spreads, which may fail to cover market-making losses on long-tail, low-volume markets;
  • Computational cost in multi-outcome extensions: every trade requires computing exp for all N outcomes, with gas cost growing linearly in N.

These problems gave rise to a number of variants.

3. LMSR Variants and a Unified Model for Multi-Outcome Events

3.1 LS-LMSR (Liquidity-Sensitive LMSR)

The core idea of LS-LMSR is to make b change dynamically with the capital that has been deployed: when more LPs join, b automatically increases and the price curve flattens; when capital withdraws, b decreases. This avoids the "capital wasted at extreme prices" issue under a fixed b, and is the solution adopted by protocols such as Augur.

In implementation, a "swap fee" and a "liquidity score" are usually introduced:

  • When an LP deposits capital, additional shares are minted at the current b;
  • b is updated according to a certain rule as total capital changes (e.g., b = k · total_funds);
  • When an LP withdraws, redemption is performed pro-rata.

The mathematical details of LS-LMSR are more complex than LMSR, especially the need to ensure that LPs cannot arbitrage by "deposit–withdraw." But it significantly improves the efficiency of liquidity allocation.

3.2 Constant-Product Multi-Outcome AMM (CPMM-style)

Another approach is to generalize Uniswap-style x*y=k to N outcomes, defining the "share product" as Π_i q_i = k. But naively using this formula breaks the conservation Σ p_i = 1. In real engineering, a "virtual balance + share renormalization" approach is usually adopted: view the prices of all outcomes as a point on the probability simplex, use a geometric mean or a harmonic function for pricing, and use the mint / redeem complete-set arbitrage operations to keep prices anchored.

This scheme is in some multi-outcome scenarios cheaper on gas (no exp needed), but the mathematical properties are not as clean as LMSR, arbitrage holes are more likely, and rigorous invariant testing is required.

3.3 Maniswap / Negative Liquidity Parameter

Protocols such as Polymatch / Manifold have proposed setting b to a negative value or a piecewise function to obtain different liquidity densities in different price ranges. Such variants can "lower slippage close to 0/1 while keeping it tight in the middle," suiting high-frequency odds markets (sports, esports), but the mathematical proof and contract implementation are more complex.

3.4 Negative Prices and Negative Liquidity

Some advanced designs allow "negative liquidity" to appear in certain price ranges, i.e., the market maker actively sells deeply out-of-the-money shares, which is essentially similar to selling options. This requires the market maker to have sufficient collateral and risk-control capability, and is usually opened only to professional market makers.

3.5 The Unified "Outcome Vector + Resolution Weights" Model

Regardless of which pricing function is used, the engineering recommendation is to use a unified data model:

  • Each event has outcomes[], each outcome has q (current share count);
  • At resolution, resolution_weights[] is written, with Σ w_i = 1;
  • Each outcome_i share redeems for w_i USDC;
  • The AMM is only responsible for producing prices based on q before resolution, and settles by w after resolution.

This abstraction unifies binary, multi-outcome, multi-winner, and scalar markets inside the same contract:

  • Binary: w = [0,1] or [1,0];
  • Multi-outcome: exactly one w_i = 1;
  • Multi-winner: multiple w_i = 1/k (proportional);
  • Scalar: weights distributed linearly according to the resulting value.

4. Minting, Split, Merge and Redemption of Shares

4.1 The Arbitrage Anchor of the Complete Set

The fundamental reason prediction markets can price stably is that there exist two risk-free operations:

  1. Mint (mint a complete set): spend 1 USDC to mint one share of each outcome;
  2. Merge / Settle (merge and redeem): send back one share of each outcome and redeem 1 USDC.

If the sum of market prices is greater than 1, an arbitrageur will mint a complete set, sell each outcome separately into the market, and lock in a profit; if the sum of prices is less than 1, the arbitrageur will buy one share of each outcome in the market and then Merge to redeem 1 USDC. This guarantees Σ p_i ≈ 1 (with a no-arb band after fees).

These two operations must be provided as first-class citizens in the contract and must share the same share ledger with the AMM.

4.2 Split and Merge

In a multi-outcome scenario, a user may not want to buy the complete set, but instead wants to split "Democrats win" into more granular sub-outcomes (e.g., "a specific candidate wins" and "some other Democrat wins"). This is the event hierarchy:

  • Parent event: Democrat vs. Republican vs. Other;
  • Child event: given that the Democrats win, who exactly is it?

Shares of parent and child events can be split and merged according to conditional probabilities. This allows the platform to compose any complex event tree from a set of small multi-outcome markets, without having to list dozens or hundreds of outcomes in one market (the latter would explode LMSR's gas cost).

4.3 Secondary-Market Transfer

Shares are ERC-1155 or ERC-20 (one token per outcome) and can be transferred in any market. The AMM is only the main source of liquidity and does not prevent over-the-counter trading or limit orders. This leaves room for future integration with OpenSea, Blur, and order-book DEXes.

4.4 Resolution and Redemption

After an event expires, the oracle writes resolution_weights and share holders redeem collateral by weight. Key design points:

  • Redemption must always be open; even if the oracle is delayed, holders can ultimately get their money;
  • "Partial resolution" must be supported (proportional redemption in multi-winner scenarios);
  • Pause redemption during the dispute window; reopen it after the dispute is resolved;
  • Invalid markets (Invalid Market) are handled by "all outcomes redeemed equally" or "all positions refunded"—see Section 8 for details.

5. Liquidity Provision and Market-Maker Models

5.1 Who Provides Initial Liquidity

The sources of prediction-market liquidity fall roughly into three categories:

  1. Platform / protocol market maker: the platform itself commits capital, sets b, and guarantees baseline liquidity;
  2. Third-party LPs: deposit capital into the AMM pool, earn fees, and bear market-making losses;
  3. Professional market makers: use their own inventory and models to quote on an order book, or inject liquidity through dedicated market-maker interfaces.

The three models can coexist. But note: under LMSR, LP PnL = fee income ± inventory PnL caused by price movement. When new information appears and prices move sharply, the LPs that entered earlier may lose money. This is similar to "impermanent loss" in Uniswap V2, but because there is an expiry and a bounded maximum loss, the risk structure is easier to quantify.

5.2 LP Shares and Returns

LPs deposit USDC and receive an LP token (ERC-20), which entitles them to:

  • A share of the fee from every trade;
  • The overall PnL of the market maker's inventory (proportionally to their share);
  • Redemption of collateral at event resolution by share proportion.

Design points to watch out for:

  • When an LP joins during an active event, the fair deposit value must be computed against the current q and b, otherwise early LPs will be diluted;
  • When an LP withdraws, do you lock until event resolution, or allow instant withdrawal? Instant withdrawal requires a "reverse mint/burn" to adjust b in the contract, which is more complex;
  • Fee distribution among multiple LPs must be allocated by capital share × time in pool, otherwise late LPs free-ride.

5.3 Hybrid Order-Book + AMM

Pure-AMM prediction markets still show obvious slippage on large orders. Professional traders and market makers are more used to an order book: they are willing to post limit orders and earn the spread instead of paying AMM fees. Hence CEX-style prediction markets (and some DEX-style ones such as Polymarket's CLOB) adopt a hybrid architecture:

  • The AMM acts as the "last liquidity backstop," always quoting;
  • The order book takes priority in matching professional market makers' limit orders;
  • User orders first take from the order book; any unfilled remainder goes through the AMM;
  • Arbitrage keeps the AMM price and the order-book midpoint aligned.

The hybrid architecture significantly improves the large-order experience, but engineering complexity is a step up—it requires a matching engine, risk control, margin, and loss handling. When SoonTech builds prediction markets for clients, we usually offer both modes and bring them online in phases based on user profile.

5.4 Dynamic b and Adaptive Liquidity

More advanced schemes adjust b dynamically based on the following factors:

  • Event approaching expiry: when close to resolution, information is more complete, price volatility should be smaller, and b can be narrowed to lower LP risk;
  • Trading volume: high-volume markets raise b to lower slippage;
  • Oracle confidence: if the news picture is highly uncertain, liquidity can be withdrawn in stages;
  • LP capital: adjusted automatically with LP deposits (LS-LMSR).

But dynamic adjustment must follow explicit on-chain rules and cannot be modified at will by operations, otherwise a "whale adjusting b" trust problem will appear.

6. Fee Models and Incentives

6.1 How Fees Are Charged

Common fee types in prediction markets:

  • Trading Fee: charged in basis points of the trade value, e.g., 0%–2%;
  • Redemption Fee: a small fee charged at resolution to cover oracle cost;
  • Profit Fee / Creator Fee: 1%–5% taken on winning share redemptions, paid to the market creator / protocol;
  • Add / Remove Liquidity Fee: to suppress short-term LP in-and-out;
  • Invalid-Market Protection Fee: a small slice of every trade goes into an "invalid-market insurance pool" to compensate LPs when a market is judged invalid.

The fee structure must avoid one issue: if you charge both a trading fee and a profit fee, the arbitrageur's no-arb band widens, and the sum of prices can persistently deviate from 1, hurting user experience. At design time, the legal range of Σp_i must be made explicit with a mathematical formula.

6.2 Creator Incentives (Market Creator)

UGC prediction-market platforms (e.g., Polymarket, Augur) allow anyone to create events. Typical incentive mechanisms are:

  • The creator takes a share (e.g., 10%–50%) of that market's fees;
  • The creator must stake a bond; if the market is judged ambiguous or invalid, the bond is slashed;
  • High-quality, high-volume markets can earn additional protocol rewards.

This mechanism must balance "encouraging open creation" against "preventing spam / manipulated markets." Bond parameters and the appeal process are key.

6.3 Liquidity Mining and Protocol Incentives

Protocols can use token rewards to early LPs and active traders to bootstrap liquidity and volume. But note:

  • Rewards should be based on "real trading volume" and "LP time-in-pool," not simple deposit size, to prevent farm-and-dump;
  • Reward release should be aligned with the event cycle, to avoid a collapse right after the event ends that drives LPs out.

7. Oracle Resolution: The Real Moat of a Prediction Market

7.1 Resolution Flow

The final value of a prediction-market asset is entirely determined by the resolution outcome; the oracle is the most sensitive link in the trust chain. A complete resolution flow usually includes:

  1. Market Close: at the preset time, trading stops;
  2. Proposal Phase: anyone can propose an outcome, usually against a bond;
  3. Challenge Phase: if someone disagrees with the proposed outcome, they can stake more tokens to raise a challenge;
  4. Escalation: the dispute escalates to a higher-level resolution mechanism (e.g., Augur's UMA fork, Polymarket's UMA optimistic oracle plus a multisig council);
  5. Final Resolution: the result is written on-chain and shares can be redeemed.

7.2 Optimistic Oracle and "Truth by Default"

Optimistic oracles such as UMA use a "propose first, wait 1–2 hours for a challenge window, considered passed if unchallenged" model. This is efficient enough on the vast majority of markets and does not require voting every time. Only when a dispute arises does it enter the truly expensive dispute-resolution flow.

7.3 Multi-Source Resolution and Redundancy

To avoid a single data source failing, on high-value markets it is recommended to:

  • Connect multiple data providers at the same time (Associated Press, Reuters, official announcements, Chainlink, UMA);
  • For quantifiable events (sports scores, crypto prices), aggregate multiple APIs directly and take the median by a predefined rule;
  • For subjective events (politics, entertainment), use multi-person voting + dispute mechanism.

7.4 Verifiability of Resolution Data Sources

A more cutting-edge approach requires the result to come with verifiable evidence: API signatures, verifiable proofs of official web pages, and digital signatures from news organizations. This reduces "who decides" disputes, but the infrastructure bar is high.

8. Invalid Markets and Dispute Handling

8.1 What Is an Invalid Market

A market may be judged invalid (Invalid) for the following reasons:

  • The event description is ambiguous, with multiple reasonable readings;
  • Data sources conflict, and the result cannot be determined;
  • The event itself never actually happened (e.g., a scheduled match was cancelled);
  • Manipulation, insider trading, or rule violations;
  • The market creator made a design error, making the result impossible to judge objectively.

8.2 Handling Capital in Invalid Markets

Common approaches:

  • Equal-proportional redemption across all outcomes: each outcome_i share redeems for 1/N USDC. This is "neutral" to all holders—no matter what you bought, you ultimately get back one share's cost. But it makes those who bought at low prices lose potential profit, and benefits those who bought at high prices;
  • Refund all trades + roll back positions: rolling back on-chain to before the event started is almost impossible once many trades have occurred;
  • Compensate at the pre-dispute market price: use a dispute-resolution pool to buy back positions at the last pre-dispute price. This is more refined but more complex.

It is recommended to default to "equal-proportional redemption," and use the "invalid-market insurance pool" funded by a small slice of every trade to make additional compensation in special cases.

8.3 Dispute Bond and Attack Cost

The dispute mechanism must make both "wrong proposal" and "malicious challenge" costly:

  • The proposer posts a bond; returned + rewarded if correct, slashed if wrong;
  • The challenger also posts a bond; rewarded on success, slashed on failure;
  • When escalating to a higher level, the bond increases by a multiplier, raising the attack cost exponentially.

Augur's "fork mechanism" is the ultimate tool: if a dispute cannot be resolved, the entire protocol forks into multiple versions and lets the market vote with its feet. This is heavy, but it guarantees ultimate correctness.

9. Risk Control, Compliance and Manipulation Protection

9.1 Common Market Manipulation Techniques

  • Large pump / dump: when the event is close and liquidity is shallow, use a large order to push the price to an extreme, misleading public opinion or other traders;
  • Insider trading: participants learn the result ahead of time (e.g., a politician's withdrawal decision, a company's earnings), and build positions before the information goes public;
  • Resolution manipulation: bribery or attack on the oracle, data sources;
  • Multi-account self-trading: fake volume and prices to farm liquidity rewards;
  • 51% attack / governance attack: in decentralized resolution mechanisms, use a large amount of tokens to vote and manipulate the outcome.

9.2 Risk-Control Tools

  • Position caps: per-address maximum position in a single market, single-market total position cap;
  • Price-band limits: pause trading / trigger a circuit breaker when short-term price movement exceeds a threshold;
  • KYC / geoblocking: restrict access in certain jurisdictions (e.g., US, UK) to avoid securities-law / gambling-law issues;
  • Transaction monitoring: on-chain + off-chain combined anomaly-detection to identify multi-account, wash-trading, insider activity;
  • Large-position disclosure: addresses with positions above a certain percentage are made public, similar to 13F;
  • Bond / loss cap: set a maximum bearable loss for LPs and market makers;
  • Cooling-off period: short pause before and after major news, to prevent instantaneous manipulation.

9.3 Legal and Compliance

Prediction markets in many jurisdictions touch on:

  • Gambling law: depends on whether it is based on "luck," whether there is a stake, and whether an "entertainment purpose" exemption applies;
  • Securities law / derivatives regulation: some event contracts may be deemed swaps or binary options;
  • Event Contracts regulation: the US CFTC has clear restrictions on event contracts such as political elections;
  • AML: requires KYC, transaction monitoring, suspicious-transaction reporting.

Different chains / deployment modes face different regulators: Polymarket has previously delisted some markets and introduced geoblocking in response to US regulation. Before designing the product, local counsel must provide an opinion, and the protocol must support geoblocking and auditable compliance tools.

10. Frontend, User Experience and Composability

10.1 Hiding Probability Inside the Experience

Ordinary users do not understand what 0.63 means, but they do understand "63% probability" and "bet 1 USDC to win back 1.59 USDC." The frontend must display simultaneously:

  • Implied probability (percentage);
  • Odds (1/p or decimal odds);
  • Potential return (spend X, win back Y);
  • A comparison with other users' / other platforms' prices.

For sports markets, also display the schedule, data and head-to-head history to lower the user's decision cost.

10.2 Trading Experience

  • Quick bet: predefined amount buttons (1/10/100 USDC), a slider;
  • Limit orders: professional users want to "buy Yes below 0.42";
  • Selling positions: let users lock in profit or stop out before resolution;
  • Multi-portfolio: buy multiple outcomes at once to build a structure such as "wins in the middle" or "wins if any outcome occurs";
  • Mobile-first: a large share of prediction-market users come from social media, so the mobile experience is critical.

10.3 Composability

  • Shares are ERC-1155 / ERC-20 and can enter the DeFi ecosystem:
  • As lending collateral (for blue-chip events);
  • Indexed by other AMMs or order books;
  • Packaged into structured products (e.g., "a basket political-event ETF");
  • Bridged into other chains.

Making shares standard tokens at contract design time is the key to capturing ecosystem dividends.

11. Engineering Implementation Essentials

11.1 Math Libraries

Solidity has no native floats; the exp / ln required by LMSR is usually implemented as:

  • ABDK Math 64.64 (fixed-point);
  • PRBMath (fixed-point, with SD59 / UD60);
  • Precompiled lookup tables (a sigmoid table works for binary markets);
  • On L2s (Arbitrum Stylus, Optimism, Base), implement with Rust / C++ for significantly lower gas cost.

Whichever you choose, full fuzz testing is mandatory: under extreme q values, verify the invariant Σ p_i = 1 (within error), that the maximum loss does not exceed b·ln(N), and that Mint/Merge is always no-arbitrage.

11.2 Contract Structure

Recommended modular layout:

  • EventFactory: creates events, sets parameters;
  • Market / Condition: state, q, b, and resolution of a single event;
  • AMM / MarketMaker: pricing and trading logic (LMSR or a variant);
  • CompleteSets: mint / merge complete sets;
  • LPVault: liquidity provision, LP tokens, fee distribution;
  • OracleAdapter: integrates UMA, Chainlink, APIs;
  • Dispute / Governance: disputes and escalation;
  • ShareToken (ERC-1155): the share token.

Separating AMM logic from shares and resolution lets you upgrade the market-making algorithm without downtime.

11.3 Gas Optimization

  • When the multi-outcome N is large, exp is expensive; precompute Σ exp and cache it, and only update the term for the bought outcome each time, computing the new price incrementally;
  • For binary markets (N = 2), LMSR can be simplified to a sigmoid and no loop is needed;
  • Use ERC-1155 batch transfers to save gas;
  • On L2 deployments, gas is not the main bottleneck, but calldata cost still deserves attention.

11.4 Indexing and Data

The on-chain data structure of prediction markets is complex (conditions, shares, positions, resolution), so you must build your own indexer with Subgraph / Ponder / Envio to provide:

  • Market list and filtering;
  • User positions and history;
  • Price K-lines;
  • LP APY;
  • Volume and liquidity dashboards.

12. Comparison of Mainstream Protocol Practices

ProtocolMarket-Making MechanismResolutionCharacteristicsAugur / Augur v2

LS-LMSR

Own REP token voting + fork

Fully decentralized resolution, gas-heavy

Polymarket

CLOB (order book) + external AMM

UMA optimistic oracle

Good UX, professional market makers

Manifold

In-house LMSR variant

Various

Sports / current affairs

Gnosis Conditional Tokens

Conditional-token framework, composable with any AMM

Pluggable

Suited to be infrastructure

Drift / Predict

Hybrid AMM + order book

Internal + multi-source

L1 / app-chain style

Several observations:

  • Pure LMSR offers worse UX than an order book, but is more decentralized and requires no market maker;
  • Large, high-attention markets (US election, World Cup) almost always have professional market makers providing order-book liquidity;
  • The choice of resolution mechanism matters more than the market-making formula—even the prettiest AMM cannot save a wrong resolution.

13. SoonTech's Prediction-Market AMM Landing Solution

13.1 Module Overview

SoonTech's prediction-market suite includes:

  1. Event & Condition Engine: unified model for binary / multi-outcome / multi-winner / scalar, with parent-child event splitting;
  2. AMM Core: LMSR + LS-LMSR + CPMM variants, switchable by event type;
  3. CLOB Bridge: optional order-book module, professional market-maker access, sharing liquidity with the AMM;
  4. CompleteSets & ERC-1155 Shares: mint / merge / transfer, standard token interface;
  5. LP Vault: LP deposit/withdraw, dynamic b, fee split, impermanent-loss monitoring;
  6. Oracle Hub: UMA, Chainlink, in-house API aggregation, multi-source verification;
  7. Dispute Framework: propose–challenge–escalate, with bonds and slashing;
  8. Risk Engine: position caps, price circuit breakers, geoblocking, suspicious-trade detection;
  9. Front-end / Mobile SDK: probability / odds / payout display, one-click bet, limit order, multi-portfolio;
  10. Analytics & Indexer: market, K-line, LP APY, on-chain dashboards.

13.2 Typical Deployment Scenarios

Scenario 1: Sports and esports prediction markets for Southeast Asia

The client wants to launch football, basketball and esports prediction in Indonesia, Vietnam and the Philippines. We deploy LMSR as base liquidity, layer in third-party market-maker order books for popular events, use multi-source sports data API aggregation + manual review for resolution, and support local payment and stablecoin deposit on mobile. Three months after launch, monthly volume exceeds $80 million with dispute rate under 0.3%.

Scenario 2: Political and macro event markets embedded in a CEX

The client is a mid-sized CEX that wants to add event contracts like "BTC month-end price" and "Fed rate cut" in its existing App. We use a CLOB + AMM hybrid architecture; the oracle prefers Chainlink and official announcements; the event contracts are wired into the CEX's unified margin system so users can use their existing contract positions as collateral.

Scenario 3: A UGC prediction-market platform

The client wants a platform where "anyone can create a market." We deploy the full Event Factory + Creator bond + UMA Optimistic Oracle, and implement market review, reporting and appeal workflows. The matching frontend supports templated creation (sports, politics, crypto, entertainment) to lower the creation bar.

13.3 Delivery Cadence

  • Weeks 1–2: business research, clarify target market types, user profile, compliance boundary;
  • Weeks 3–6: contract development (LMSR + CompleteSets + LPVault + Oracle Adapter), testing;
  • Weeks 7–8: audit, testnet + shadow mainnet, oracle integration;
  • Week 9: frontend and App integration, risk-rule configuration;
  • Week 10: mainnet launch, limits + multisig monitoring, 24/7 on-call;
  • Afterward: order book, parent-child events, cross-chain deployment, market-maker onboarding.

14. Enterprise Landing Recommendations

14.1 Which Kind of Events to Start With

  • Recommend starting with quantifiable events with clear data sources (crypto price, sports score, macro data). Do not start with subjective political events;
  • Keep the event cycle short (1–7 days is best), so users can participate repeatedly and the product can iterate;
  • In the early phase, limit to 5–10 concurrent markets, keep liquidity concentrated, and avoid "every market is shallow."

14.2 Team Composition

Minimum team: 1 PM, 2 smart-contract engineers, 1 backend / indexer, 1 frontend / mobile, 1 risk / data, 1 ops / market review. Adding an order book requires 1–2 more matching engineers; UGC and dispute mechanisms require content review and legal support.

14.3 Key Metrics

  • Volume and user count: DAU, daily volume, single-market peak;
  • Liquidity metrics: bid-ask spread, slippage curve, LP capital;
  • Resolution quality: dispute rate, wrong-resolution rate, average resolution time;
  • Risk metrics: manipulation attempts, blocked abnormal trades, jurisdictional compliance hit rate;
  • LP economics: LP net yield, retention, market-making loss / fee ratio;
  • Business metrics: fee revenue, platform take, value per user.

15. Future Trends

15.1 Prediction Markets and AI Information Markets

AI Agents will become important participants in prediction markets: they scrape news, social media and on-chain data in real time and trade rapidly before the event outcome becomes clear. This will improve market efficiency, but also raises concerns about "bots squeezing out retail." Designs such as delayed disclosure, tiered fees and dedicated Agent markets can be used to address this.

15.2 Real-World Assets (RWA) and Event-ization

Turning RWA events such as interest rates, FX, commodities, and insurance claims into prediction markets for pricing is a growing direction. It blends traditional finance's forwards / options with prediction markets and raises the bar on compliance and settlement.

15.3 Professionalization of Resolution Infrastructure

As prediction markets scale, oracle resolution will evolve from "optimistic assertion" to "verifiable fact": digital signatures from news organizations, cryptographic proofs from official APIs, and ZK-Coprocessors handling complex data will all become infrastructure.

15.4 The Spread of L2 and App-chains

Prediction markets trade frequently with small per-trade amounts, and are naturally suited to high-throughput, low-gas L2s or app-chains. In the next 1–2 years, more dedicated prediction chains will appear, or prediction-market app-chains on existing L2s.

15.5 Regulatory Clarity

Jurisdictions such as the US, UK, EU, Singapore, and Dubai are progressively clarifying the regulatory boundary of event contracts. A clear compliance framework will let institutional capital and traditional market makers enter, and the total size of prediction markets is expected to grow by an order of magnitude.

FAQ

Q1: What is the fundamental difference between LMSR and a Uniswap-style AMM?

A: LMSR prices a set of probabilities—prices always sum to 1. Uniswap prices the relative value of two independent assets. The LMSR market maker's maximum loss is bounded (b·lnN); Uniswap LPs have unbounded impermanent loss. Both use the AMM idea, but the math and risk profile differ greatly.

Q2: Why is there still slippage when buying even though the price is already very certain (e.g., 0.99)?

A: LMSR's softmax still has slope near p = 0.99. Pushing the price from 0.99 to 0.995 can cost even more than pushing it from 0.5 to 0.6. This "liquidity gets more expensive at extreme prices" phenomenon is a common criticism of LMSR; LS-LMSR and similar variants are designed to improve it.

Q3: Will the market maker / LP lose money?

A: Yes. When the market reprices sharply on new information, market makers that built inventory earlier may lose money. The maximum loss is bounded (b·lnN), but the actual loss depends on the price path. LPs should plan to cover such losses with fee income and be cautious about providing liquidity on high-volatility events.

Q4: If I have conviction about the outcome, at what price should I buy?

A: Buy Yes when your subjective probability is higher than the market price (p_market < p_you); the expected return is then positive. But also factor in resolution risk, liquidity, fees and time cost. Don't risk 1% on a wrong resolution just to win 1% at a price of 0.99.

Q5: What happens if the market is judged invalid?

A: The mainstream approach is that all shares redeem equally at 1/N, plus additional compensation from the "invalid-market insurance pool." Read the platform's invalid-market policy before trading, and avoid betting on markets with ambiguous descriptions.

Q6: How long does it take to build a prediction market from scratch?

A: A basic LMSR + binary market + simple oracle can reach testnet in 3–4 weeks; including multi-outcome, LP vault, hybrid order book, dispute mechanism, full frontend and risk control usually takes 3–4 months. It is recommended to customize on a mature suite (such as SoonTech's solution) rather than write from scratch.

Conclusion

The AMM of a prediction market looks on the surface like just a pricing formula, but it sits at the intersection of financial engineering, decentralized resolution, oracles, risk control, compliance and user experience. LMSR has become the industry standard not only because of its elegant math, but also because its maximum loss is bounded, its price naturally satisfies a probabilistic interpretation, and it is perfectly compatible with "complete-set arbitrage." But what really determines the success or failure of a prediction-market product is rarely the pricing function itself—it is the credibility of the resolution mechanism, the depth of liquidity, the rigor of risk control, and the smoothness of the user experience.

This article has systematically walked through the complete design space of prediction-market AMM, from financial structure, LMSR and its variants, share system, liquidity provision, fee incentives, oracle resolution, invalid markets, risk and compliance, frontend experience, engineering implementation, to a comparison of mainstream protocols. As the 2026 US election, the World Cup, crypto ETFs and macro interest-rate events keep pushing prediction markets into the mainstream, the field is poised for a new round of product and infrastructure explosion.

The SoonTech team has deep experience across multiple product lines including prediction markets, CEX, and DEX. Prediction-market AMM is one of our most differentiated modules, already live across Southeast Asian sports, CEX event contracts, UGC platforms and more. If your team is building a prediction market, adding event contracts to an existing trading platform, or looking to embed prediction capability into your own application, we would love to chat. Based on your target market, user profile and compliance requirements, we can deliver an end-to-end solution from contract development, oracle integration and risk design to frontend and App.

Let the wisdom of the crowd be priced, let information discovery be more efficient, and let everyone with a view be able to participate—this is the long-term value of prediction markets, and the reason we keep refining the infrastructure.

🌐 Build secure and scalable Web3 platforms with SoonTech.

Explore our solutions for White Label Crypto Exchanges, Prediction Markets, MPC Wallets, Matching Engines, Liquidity Integration, and Compliance.

ابدأ رحلة blockchain الخاصة بك

سيقدم لك الفريق المحترف استشارة مجانية حول الحلول

اتصل بنا