Technical Whitepaper · Version 1.0
Polyquest: A Multi-Engine Prediction Market Protocol with Liquidity-Sensitive Market Making and Any-Token Collateral on Solana
Abstract
Prediction markets have become a large and fast-growing asset class,
yet retail participation still meets four frictions: a single
collateral currency, custodial deposits, curated market creation,
and missing liquidity in long-tail markets. We present Polyquest, a
self-custodial prediction-market protocol on Solana that composes
three market engines behind one interface: a parimutuel Pool vs Pool
engine, an automated market maker based on the liquidity-sensitive
logarithmic market scoring rule (LS-LMSR), and an integration of
Polymarket's central limit order book through per-user embedded
wallets. On top of the engines, creators open markets for their
audiences and curate existing markets, including Polymarket markets,
so that followers can find markets the creator has evaluated. For
the LS-LMSR in the form used by the Engine II program, we decompose
each price into an LMSR weight plus a common entropy surcharge,
derive the exact range of the overround, prove a solvency margin and
a worst-case seed loss of
fixed at market open, and characterize saturation limits, including
marginal prices above one. We describe an unsigned 128-bit
fixed-point implementation with rounding in favor of the pool and
prove that solvency holds for any deterministic approximation of the
cost function that dominates the largest liability, independently of
the accuracy of exp and ln. Markets can be
denominated in any registered SPL token, and traders can pay with
another token through a swap composed with the trade in one atomic
transaction; price feeds never enter the trade path. In simulation
at scale (
trades in 100,000 markets carrying
USD of simulated notional volume), no invariant was violated at a
relative tolerance of
, and depth grew in proportion to volume, reaching
USD after
USD of volume, while the depth of an LMSR with equal worst-case loss
did not grow and ended at 9.4 USD. We also report where the LS-LMSR
is weaker: from the seed state it is never cheaper than an
equal-loss LMSR for a single order, and its overround grows as
with the number of outcomes.
Keywords: prediction markets; automated market makers; logarithmic market scoring rule; liquidity sensitivity; parimutuel markets; fixed-point arithmetic; Solana; self-custody; mechanism design.
1Introduction
A prediction market trades contracts whose payoff depends on the outcome of a future event, and the prices of such contracts are commonly read as probability estimates [1, 2]. After decades as a research instrument, the category has become a mainstream market. Industry estimates put 2025 volume at about 51 billion USD, with projections of one trillion USD by 2030 [3]; thirty-day volume across the largest venues reached 68.0 billion USD in September 2026 [4]; and markets on the 2026 FIFA World Cup alone traded about 20 billion USD, compared with 3.6 billion USD for the 2024 United States election [5]. Regulators have responded with proposed rules for event contracts [6].
This growth is concentrated in a small number of venues that share a common design: curated listings, a single dollar-denominated collateral, and either an order book fed by professional market makers or a custodial account model. The design suits large, widely followed events. It serves a second class of markets poorly: the long tail of questions posed by communities, creators and live broadcasts, which are individually small, short-lived and numerous. For these markets we identify four frictions.
- F1. Single collateral. Participants must convert into the venue's one currency before trading, and a community cannot denominate a market in its own token.
- F2. Custody. Account-based venues take deposits, which concentrates counterparty risk in the operator and adds an onboarding step before the first trade.
- F3. Curated supply. When an operator approves every market, the number of markets is bounded by the operator's review capacity rather than by demand.
- F4. Long-tail liquidity. An order book quotes only where makers choose to quote; a logarithmic market scoring rule quotes everywhere but requires a subsidy fixed before the operator knows how much volume a market will attract [7]; a parimutuel pool needs no subsidy but offers no price at entry [8].
No single mechanism removes all four (Section 2.8). Polyquest therefore composes three engines behind one interface on Solana [9], with permissionless market creation, any-token collateral and self-custody as shared properties. Engine I is a parimutuel Pool vs Pool market that needs no seed capital and suits community markets in custom tokens. Engine II is an automated market maker based on the liquidity-sensitive logarithmic market scoring rule (LS-LMSR) of Othman et al. [10], which quotes two-sided prices at every moment, bounds the seed provider's loss by a quantity fixed at market open, and deepens as volume grows; it runs Polyquest's own markets, including minute-scale live markets shown alongside a broadcast. Engine III routes orders to Polymarket's central limit order book through a per-user embedded wallet, so that users of a Solana wallet can reach external order-book liquidity without an omnibus account. A creator layer sits on top of the engines: creators open markets that bring their audiences and insights to Polyquest, and curate existing markets, including Polymarket markets, so that followers can find markets the creator has evaluated (Section 9.6).
1.1Contributions
- Architecture. We define self-custody for a market engine, state the trust assumptions of each engine explicitly, and show how an external order book can be integrated through per-user embedded wallets and a relayer without pooling user funds, together with a creator layer for market creation and curation (Sections 3, 4 and 7 to 10).
- Analysis of the Engine II market maker. We give an entropy decomposition of LS-LMSR prices, the exact range of the overround, a solvency margin, a bound on the seed loss that is sharper than the general bound because it credits the seed provider's own shares, saturation limits of prices, and a design requirement that rules out par minting of complete sets (Section 5 and Appendix B).
- Integer implementation. We describe the unsigned 128-bit fixed-point evaluation of the cost function with a numerically stable log-sum-exp and an exponent cutoff, prove that solvency and the absence of profitable trade cycles hold for any deterministic approximation that dominates the largest liability, independently of the accuracy of the elementary functions, and measure a reference emulation to within a few units in the last place on inputs per routine (Section 6 and Appendix C).
- Any-token execution. We keep price feeds out of the trade path and prove a bounded-execution property for a swap and a trade composed in one atomic Solana transaction (Section 7).
- Security and economics. We analyze eighteen threats across the three engines, state six invariants of Engine II, and derive a worst-case break-even volume for a creator who seeds a market (Sections 11 and 13).
- Evaluation at scale. We evaluate price impact, liquidity sensitivity, solvency and information aggregation in a reproducible simulation study with trades in 100,000 markets, single-market paths reaching USD of volume, and trading decisions across four mechanisms, and we report where the LS-LMSR underperforms its benchmarks (Section 12 and Appendix E).
1.2Scope and Status
This paper describes the design of the three engines and specifies the Engine II program, whose constants are collected in Appendix D. The program will undergo an external security audit after deployment. All quantitative results on market behavior come from simulation or from exact and fixed-point computation; the paper reports no live operational metrics. Token design is outside the scope of this paper, and none of its results depends on a token. Section 3.2 describes USDP, an SPL token that Polyquest uses as a dollar-denominated reward unit.
1.3Organization
Section 2 reviews the mechanisms that Polyquest builds on. Section 3 states the system model. Sections 4 and 5 analyze Engines I and II, and Section 6 describes the fixed-point implementation of Engine II. Section 7 covers collateral and swap-to-bet execution, Section 8 the Polymarket integration, Section 9 the market lifecycle and Section 10 cross-chain access. Section 11 analyzes security, Section 12 reports the simulation study, Section 13 discusses fees and protocol economics, and Section 14 states limitations and future work. The appendices contain notation, proofs, algorithms, constants, the simulation configuration and a disclaimer.
2Background and Related Work
This section reviews the mechanisms from which Polyquest is assembled. We focus on three properties that matter for a permissionless venue with many small markets: who bears the risk of quoting, whether quotes are always available, and how depth responds to volume.
2.1Prediction Markets as Information Aggregators
The price of a contract that pays one unit if an event occurs is commonly read as a probability estimate [1]. Election futures markets have produced forecasts that compare favorably with contemporaneous polls over long samples [11], and Arrow et al. argued that such markets deserve regulatory room as forecasting tools [2]. The probability reading has limits: with heterogeneous beliefs and budget-constrained, risk-neutral traders, the equilibrium price identifies a quantile of the belief distribution rather than its mean [12]. Ostrovsky characterizes the securities for which dynamic trading among strategic, privately informed traders aggregates information: for separable securities, prices converge to the full-information value in every equilibrium [13]. Hanson and Oprea show that an attempted manipulation can raise accuracy, because the manipulator's predictable orders increase the return to informed trading [14].
Two design requirements follow. Aggregation needs a counterparty at every moment, so that informed traders can act when information arrives, and the cost of moving the price must be high enough to make noise and manipulation expensive but low enough to reward information. Both are properties of the market-making mechanism.
2.2Market Scoring Rules and the LMSR
A scoring rule pays a forecaster who reported when outcome occurs; it is strictly proper if truthful reporting uniquely maximizes the expected score [15]. The quadratic rule [16] and the logarithmic rule are standard examples. Hanson's market scoring rule makes a proper rule sequential: each trader replaces the standing forecast, pays its score, and is paid the score of the new one [17, 7]. Payments telescope, so the operator loses at most the score range, which for the logarithmic rule started at the uniform forecast is .
The logarithmic market scoring rule (LMSR) is equivalently an automated market maker selling outcome shares, each paying one unit if its outcome occurs, at the cost , with prices that sum to one [7]. The single parameter controls both the subsidy and the price response. In a balanced binary market, buying shares of one outcome moves its price from to . A small gives a thin market that is cheap to manipulate; a large gives depth but a large worst-case subsidy and slow price discovery when few traders arrive. Because is fixed at creation, depth is the same at ten units of volume or ten million, so the operator must forecast volume before the market opens. That is not feasible when anyone can create markets and most markets are small.
2.3Cost-Function Market Makers and the Convex Framework
Chen and Pennock generalize the LMSR to market makers defined by a cost function : a trade costs and instantaneous prices are the gradient [18]. Abernethy, Chen and Wortman Vaughan obtain the desirable properties (path independence, no arbitrage, information incorporation, expressiveness, bounded loss) from convex cost functions with gradients in the probability simplex, written as conjugates of a regularizer over prices, and connect market making to online learning [19]. Path independence means that a sequence of trades costs the same as its net trade, so splitting orders neither helps nor hurts and liability depends on the share vector alone. Translation invariance, , makes a complete set of shares (one of each outcome, which pays exactly one unit in every state) cost exactly one unit, and is equivalent to prices summing to one. Chen and Pennock survey the resulting design space [20].
2.4Liquidity Sensitivity and the LS-LMSR
Othman, Pennock, Reeves and Sandholm call a market maker liquidity sensitive if a fixed trade moves prices less when more shares are outstanding, and show that no market maker can be path independent, translation invariant and liquidity sensitive at the same time [10]. Their liquidity-sensitive LMSR (LS-LMSR) keeps path independence and gives up translation invariance by letting the LMSR parameter grow with outstanding interest, . Two consequences follow. Depth grows in proportion to the number of outstanding shares, so a market needs only a small seed to open and becomes deeper as it is used. Prices sum to more than one, the sum being at most [10], and this overround acts like a commission built into the quotes. The worst-case loss remains bounded and is set by the initial seed [10]. Section 5 derives these properties in the form used by Polyquest and sharpens the bounds.
2.5Parimutuel Mechanisms
In parimutuel betting, stakes on each outcome are pooled and the winning pool shares the losing pools pro rata, less a commission. The operator bears no risk and needs no liquidity provider, but odds are not fixed when a bet is placed: the payout ratio depends on all later bets, and racetrack data show persistent biases such as the favorite-longshot bias [8]. Pennock's dynamic parimutuel market combines a parimutuel pool with a share price that changes as shares are bought, so that early informed traders are rewarded while the operator's risk stays limited to its initial subsidy [21]. Engine I of Polyquest (Section 4) is a plain parimutuel pool.
2.6Constant-Function Market Makers and Prediction-Market AMMs
A constant-product market maker (CPMM) holds reserves of two assets and accepts any trade that preserves [22]. Angeris and Chitra give conditions under which arbitrage keeps the price of a constant-function market maker close to a reference market [23]. The Gnosis conditional tokens framework lets anyone split collateral into a complete set of outcome tokens at par and merge a complete set back into collateral [24]. The fixed-product market maker (FPMM) built on it converts a buyer's collateral into complete sets and releases outcome tokens so that the product of its reserves is preserved; prices sum to one, and depth comes from liquidity providers' deposits rather than from volume [24]. Moallemi and Robinson's pm-AMM chooses the invariant so that, under Gaussian score dynamics, liquidity providers' expected loss to arbitrageurs is uniform across prices, and a dynamic variant reduces liquidity as expiry approaches [25]. Slamka, Skiera and Spann compare automated market makers experimentally and report that the choice of mechanism and its liquidity setting affect forecasting performance [26].
2.7Order-Book Prediction Markets
In a central limit order book (CLOB), makers post limit orders and takers cross them; the venue itself holds no inventory and pays no subsidy. Polymarket operates a CLOB with off-chain order matching and non-custodial on-chain settlement of signed orders against conditional-token positions [27, 24]. Depth is endogenous: it is high where professional makers are active and thin or absent elsewhere. Because complete sets can be split and merged at par, arbitrage keeps the sum of best prices close to one, but nothing guarantees that a quote exists at a given moment.
2.8Positioning
Table 2.1 summarizes the comparison along the properties discussed above.
| Mechanism | Operator worst-case loss | Depth adapts to volume | Always-available quotes | Needs counterparties or makers | Prices sum to one | Fit for long-tail markets |
|---|---|---|---|---|---|---|
| Parimutuel | None | Yes, with pool size | No; odds float until close | Yes, stakes on other outcomes | Yes () | Good; no subsidy, uncertain odds |
| LMSR | No; fixed | Yes | No | Yes | Limited; set in advance | |
| LS-LMSR | , net of seed shares | Yes; | Yes | No | No; | Good; small seed, depth grows |
| CPMM, FPMM | Bounded by deposits | Only through deposits | Yes | Yes, liquidity providers | Yes (FPMM) | Limited; needs deposits |
| CLOB | None | Through makers only | Only if makers quote | Yes, makers | Approximately, by arbitrage | Poor; thin books |
No row dominates. Mechanisms without operator risk (parimutuel, CLOB) depend on other participants being present, while mechanisms with always-available quotes (LMSR, LS-LMSR, CPMM) put someone's capital at risk. Polyquest therefore composes three mechanisms as complementary engines. Engine I is a parimutuel pool for community markets, often denominated in custom tokens, where no subsidy is available and pro-rata payoffs are acceptable. Engine II is an LS-LMSR for Polyquest-native markets, including minute-scale live markets, which require two-sided quotes at every moment and whose subsidy must be bounded and known when the market opens; liquidity sensitivity lets such markets open with a small seed and deepen with use. Engine III routes to Polymarket's CLOB for markets in which external makers already supply depth. Sections 3 to 8 describe the architecture, each engine, and the collateral and execution layer they share.
3System Model and Architecture
This section fixes the actors, custody model, design goals and trust assumptions used in the rest of the paper, and describes how the three engines are composed behind one interface. Section 11 analyzes these assumptions against concrete adversaries.
3.1Actors
An actor is defined by the capabilities it holds, not by the organization that operates it.
- Trader. A holder of a Solana keypair, who signs every Solana transaction that moves its assets. For Engine III the trader also controls a per-user embedded EVM wallet (Section 8).
- Market creator. Any wallet that opens a market and sets its parameters (Section 9.1); it receives the fee share . A creator can also curate existing markets, including Engine III markets, for its followers (Section 9.6).
- Seed provider. For Engine II, the account that posts the seed collateral and bears the worst-case loss (Section 5), usually the creator. Engine I needs no seed.
- Designated resolver. A role named in each market's rules whose action finalizes the realized outcome (A2; design space in Section 9.3).
- Relayer. An EVM-side service that submits gasless Polygon transactions for Engine III users (Section 8).
- Swap venue. The Jupiter aggregator, whose routes are composed with trades for swap-to-bet (Section 7) [28].
- Bridge. Mayan, for bringing assets into Solana [29], and a USDC route that funds the Engine III wallet (Section 10).
- Price feed. A source of token prices for display and creation gating only (A5).
- Operator. The party that runs the interface and its off-chain services: indexing chain state, aggregating the Polymarket feed and constructing transactions for the trader to sign. In this role it is not a counterparty in any engine; whoever seeds an Engine II market, a creator or the operator, acts as its seed provider.
3.2Assets and Custody
Each Engine I or Engine II market is denominated in one collateral token , an SPL mint [30]. Market collateral is held in accounts owned by the Polyquest programs and moves only as program logic permits: on a trade, a fee transfer or a redemption. Engine II positions are outcome shares from per-outcome share mints, held in the trader's own token accounts; Engine I records each trader's stakes on-chain; Engine III positions are conditional-token positions held by the trader's embedded wallet on Polygon.
A market engine is self-custodial if (i) every transfer out of an account controlled by a trader requires that trader's signature, (ii) market collateral is held by program-owned accounts that no operator key can debit, and (iii) the program releases collateral only under rules fixed when the market was created.
Polyquest never takes custody of user deposits and operates no omnibus account in which funds of different users are pooled. Engines I and II satisfy Definition 3.1 relative to the program code. Engine III satisfies property (i) only relative to assumption A4, because its signing is automated; Section 8.3 states which parties this places in the trust boundary.
USDP. Polyquest consolidates its various user rewards into USDP, an SPL token denominated in US dollars that functions as a points balance within the platform (unrelated to other assets that share the ticker). USDP is not a stablecoin: Polyquest does not guarantee its redemption at 1 USD or its exchange for USDC at 1:1. A USDP pool can be created on a decentralized exchange, but the price in such a pool is set by its traders, not by Polyquest. The future uses of USDP follow Polyquest's reward policy and are outside the scope of this paper.
Definition 3.1 is conditional on the program code. If a program is upgradeable, the holder of the upgrade authority can change the rules in (iii) and is a trusted party; Section 11 treats this authority and the registry authority.
3.3Design Goals
- G1. Self-custody. No user deposit passes through an operator-controlled account (Definition 3.1).
- G2. Permissionless market supply. Any wallet can open a market; quality is controlled ex post (Section 9.5).
- G3. Any-token collateral. A market may be denominated in any registered SPL mint, and a trader may pay with a token other than the collateral (Section 7).
- G4. Bounded seed risk. Where an automated market maker supplies liquidity, the seed provider's loss is bounded by a quantity fixed at market open.
- G5. One interface over heterogeneous liquidity. Parimutuel pools, a cost-function market maker and an external order book appear in one feed.
3.4Trust Assumptions
- A1. Solana provides safety and liveness: transactions execute atomically and in some total order, and valid transactions are eventually included [9, 31].
- A2. The designated resolver of a market reports the outcome defined by that market's rules and resolution source.
- A3. Swap routes execute within the slippage bound stated in the transaction, or the transaction fails (Section 7.3).
- A4. For Engine III, the embedded-wallet provider manages keys as documented, the component authorized to request signatures stays within its policy, and the relayer is live (Section 8.3).
- A5. Price feeds are used only for display and creation gating, never to price a trade.
A5 is a design constraint rather than an assumption about a third party: a manipulated or stale feed can affect which markets are admitted and what is displayed, but not a trade price or a market's solvency (Section 7.2).
3.5Architecture
Figure 3.1 shows the components. On Solana, the
Engine I and Engine II programs hold market state and collateral. The
Engine II program is written with Anchor
[32] under program
ID 4tjbrvyzZ4PVuCnLKhrbbpcKd4ghnT6xxWPLQ2Mav68z; its
state accounts are Market, Registry and
CollateralEntry. On Polygon, Engine III uses Polymarket's
order book and settlement contracts through the trader's embedded
wallet. The interface reads both chains, tags each market by engine
(for example "LS-LMSR" and "CLOB") and builds
transactions, but signs no Solana transaction and holds no funds.
| Engine I: Pool vs Pool | Engine II: LS-LMSR | Engine III: Polymarket CLOB | |
|---|---|---|---|
| Pricing rule | Pool ratio ; payout fixed at | Cost function | Limit orders, matched off-chain |
| Counterparty | Traders in losing pools | Seeded market maker | Other order book traders |
| Collateral | SPL mint | Registered SPL mint | Polymarket collateral on Polygon |
| When quotes exist | Indicative odds only | Always, buy and sell, until | When the book holds orders |
| Operator or seed risk | None; budget balanced | Seed loss at most | None for Polyquest |
| Typical market | Community and custom-token | Polyquest Originals, live markets | Polymarket-listed events |
| Settlement | Solana program | Solana program | Polygon contracts |
Table 3.1 shows that the engines are complementary. Engine I needs no seed and no price source, which suits long-tail markets in community tokens. Engine II provides continuous two-sided quotes at a bounded cost to the seed provider, which suits short and live markets. Engine III gives access to external order book liquidity without Polyquest acting as counterparty or custodian.
4Engine I: Pool vs Pool (Parimutuel) Markets
Engine I is a parimutuel market. Each outcome has its own pool, traders stake collateral into outcome pools, the ratio of the pools sets the implied odds, and at resolution the winning pool shares the losing pools pro rata. The mechanism has a long history in racetrack betting [8] and was studied as a prediction market design by Pennock [21]. We give a formal model, prove two properties of the fee rule, and discuss the limitations that motivate Engine II.
4.1Model
A Pool vs Pool market consists of outcomes , a collateral mint , a fee rate with shares , and a close time . Its state is the collection of stakes of traders in pools , with pool totals and total stake . Before , a trader may add stake to any pool; in our model a stake is irrevocable once placed. After the designated resolver reports , trader may claim
and the fee
is paid to the creator () and the protocol ().
Before resolution, the interface displays the implied probability and the decimal odds before fees. Under Eq. (4.1), a unit staked on outcome returns, if wins,
The fee is thus charged on the transfer from losing to winning traders, not on the returned stake. Figure 4.1 illustrates the settlement flow for .
4.2Budget Balance and the Losing-Side Fee Rule
If , then . In particular, the market never needs collateral beyond the stakes it holds, and neither the operator nor any seed provider bears a loss.
Under Eq. (4.1), every trader with receives , with equality if and only if . Under the alternative gross-pool rule , which charges the fee on , a winner receives less than its stake if and only if .
From Eq. (4.1), , since and ; the difference vanishes exactly when . Under the gross-pool rule, holds if and only if , that is, .
Proposition 4.3 matters for markets with a heavy favorite. Under a gross-pool fee, a trader who backs an outcome with implied probability above and is right still loses money, which is difficult to explain to retail users and penalizes accurate reporting. The losing-side rule avoids this by construction, and a one-sided market () returns every stake in full with no fee.
Payouts are amounts in base units of , with grid unit . An implementation must round each claim down to the grid so that Proposition 4.2 holds as . The residual is less than for winning claims, and its disposition is part of the market's rules.
4.3Price Discovery Without a Quote
A parimutuel market quotes no price at entry. The payout ratio of Eq. (4.3) is determined by the pools at , not at the time of the stake. A stake into pool moves the implied probability from to and lowers the payout ratio of everyone already in pool to
while raising for every . Early stakers therefore carry odds drift that they cannot hedge within the market, and a trader who stakes just before observes nearly final pools and possibly more information about the outcome. This late-entry advantage, together with the favorite-longshot bias documented in racetrack pools [8], limits the quality of parimutuel odds as forecasts. Pennock's dynamic parimutuel market makes the payout depend on the price at the time of purchase to address this [21]. We keep Engine I in its classical form and serve markets that need a quoted price with Engine II instead. A close time that precedes the public observability of the outcome (Section 9.2) removes the most damaging form of late entry.
4.4Cold Start and Empty Pools
A parimutuel pool is only informative once several pools hold stake. The first trader in an empty market faces the widest odds drift: every later stake in the same pool dilutes its payout through Eq. (4.4), and nothing guarantees that stake on other outcomes will follow. Polyquest offers early-bettor liquidity incentives to offset this cold start; we treat them as an external subsidy and do not model them.
If the realized outcome has an empty pool (), Eq. (4.1) is undefined: no trader holds a claim on the losing stake. The disposition of stakes in this case must be fixed by the market's rules before trading opens, because otherwise the resolver's report would trigger a transfer that no rule defines. We do not prescribe a rule here.
4.5Suitability for Community Markets
Engine I is used most heavily for community and custom-token markets, and its properties explain why. By Proposition 4.2, payouts are funded entirely by stakes, so a creator can open a market without seed capital and no party bears market-maker risk. All accounting is in units of , so the engine needs no price source, and a volatile token's value can move without affecting the market's ability to pay. The payout rule is simple enough to be stated in one sentence. The cost is the absence of a quote, odds drift and the cold start, which are the properties that Engine II is designed to remove.
5Engine II: The Liquidity-Sensitive LMSR Market Maker
This section develops the mathematics of Engine II. We state the cost function used by the Polyquest program, derive its prices, and prove the properties on which the implementation relies: homogeneity, a two-sided bound on the overround, solvency, a fixed worst-case seed loss, bounded exponents, and the behavior of trades under rounding. Longer proofs are in Appendix B. Every inequality stated here was also checked numerically at 50 to 80 significant digits (Appendix B.6).
5.1Model and Cost Function
A market has mutually exclusive and exhaustive outcomes. The state is the vector of outstanding shares, seed shares included; a share of outcome pays one collateral unit if .
For and , let
A market opens at the seed state with , so that , and the seed provider posts . The protocol restricts to with default .
Because , prices are undefined at the origin; the seed fixes both the initial prices and the initial liquidity . We use three auxiliary quantities throughout: the scaled quantities , the weights , and the Shannon entropy . Since , the vector ranges over the simplex , and every quantity below depends on only through and the scale . We also write .
5.2Prices
For every in the domain,
which equals the expression of Othman et al. [10],
The proof is in Appendix B.1. Equation (5.3) splits each price into the LMSR price at the current liquidity and a surcharge common to all outcomes. We checked Eqs. (5.3) and (5.4) against central finite differences of Eq. (5.2) at 300 random states; the largest discrepancy was . The displayed probability follows directly:
The display is thus the LMSR weight vector shrunk toward the uniform distribution; it preserves the ranking of outcomes, and the shrinkage decreases as the market concentrates on one outcome, to a limit that is negligible for small but not for large and (Proposition 5.10).
5.3Homogeneity and Liquidity Sensitivity
For all and : (i) and ; (ii) ; (iii) is convex, every is strictly positive, and is nondecreasing in .
(i) leaves unchanged, so scales by and , a function of by Eq. (5.3), is unchanged. (ii) is Euler's theorem for functions homogeneous of degree one; directly, . (iii) is proved in Appendix B.2.
Homogeneity is the precise sense in which the LS-LMSR is liquidity sensitive.
For and any trade that keeps the states involved in the domain,
where is the trade cost of Eq. (5.13). Consequently the price Jacobian satisfies , the depth satisfies , and at a balanced state the own-price slope is , the slope of an LMSR with parameter .
Apply Proposition 5.3(i) to ; the cost identity follows from homogeneity of . Differentiating the price identity gives the Jacobian, and scales because prices are invariant and costs scale by . The balanced slope is read off the Hessian in Appendix B.2.
A trade of fixed size therefore moves prices times less when times more shares are outstanding. In an LMSR, by contrast, prices depend only on the differences and depth is fixed by regardless of volume. Figure 5.1 compares the two at equal worst-case loss.
5.4Overround
For every , the overround satisfies
The upper bound holds with equality if and only if , and the lower bound if and only if for some . In particular on the whole domain.
The upper bound is the one given by Othman et al. [10]; Eq. (5.7) and the lower bound are proved in Appendix B.3. For small the lower bound is negligible: , which is for and for at . At and , however, it is : the overround never falls below 43 percent. Table 5.1 lists the maximal overround, and Figure 5.2 shows how the overround decays as a market concentrates.
| 0.01 | 1.39 | 3.30 | 5.55 | 16.64 |
| 0.02 | 2.77 | 6.59 | 11.09 | 33.27 |
| 0.05 | 6.93 | 16.48 | 27.73 | 83.18 |
| 0.10 | 13.86 | 32.96 | 55.45 | 166.36 |
| 0.20 | 27.73 | 65.92 | 110.90 | 332.71 |
A holder of outcome sells at the marginal price , so at the margin a holder faces no spread. A trader without inventory who wants exposure against must buy every other outcome, at a marginal cost of per unit of payoff, which is equivalent to selling at . For such traders is the width of a bid-ask spread around . It is largest in balanced markets and shrinks as a market concentrates: for and it is 6.93 percent at , 2.98 percent at , and 0.45 percent at .
5.5Solvency and Bounded Seed Loss
For every and every , the outcome capacity satisfies
so . A vault holding can therefore pay one collateral unit per winning share whatever the outcome.
. Since and , , so .
The capacity has derivative , so buying outcome consumes its headroom while (see Proposition 5.11 for the complementary case).
Let the seed provider post and hold the seed shares of every outcome. Then
If trading ends at and outcome wins, the market maker's net loss (payouts to shares other than the seed, minus trading revenue before fees and rounding) is
However the residual is allocated, the seed provider redeems at least , so its loss never exceeds , which is fixed when the market opens.
. Before fees and rounding the vault holds , and Eq. (5.11) is a rearrangement using Eq. (5.9).
Othman et al. bound the market maker's loss by [10]; Eq. (5.11) is sharper because it credits the seed provider with the seed shares it holds, which always redeem for . Two consequences are worth stating. By Proposition 5.3(ii), , so equals the maximal overround. And because is homogeneous of degree one, the market maker's result turns positive once outstanding interest is large enough in a given direction, since then .
5.6Bounded Exponent, Capacity at Saturation and Price Limits
For every , and , where . Hence every weight relative to the leader satisfies .
and ; divide by .
The implementation evaluates exponents relative to the leader and clamps them at (Section 6). By Lemma 5.9 the clamp can bind only if , that is , which is reachable within the allowed range. At the smallest relative weight is , far below the WAD resolution .
For every and every ,
The upper bounds are attained at and the lower bound at , . For small , .
The proof is in Appendix B.4. The price floor is therefore of order rather than , and the displayed probability of the leader cannot exceed . Table 5.2 shows that the ceiling is irrelevant in practice for but binding for with many outcomes.
| , | , | , | , | |
|---|---|---|---|---|
| 0.01 | ||||
| 0.025 | ||||
| 0.05 | ||||
| 0.10 | ||||
| 0.20 |
The ceiling is not an artifact of the limit.
If for all , then . Along the path this holds once .
The proof is in Appendix B.4. For and the threshold is , and numerically the crossing occurs at ; for it is . Buying beyond this point costs more than the largest possible payout, so no rational trader does it, and solvency is unaffected. Along the same path the capacity is smallest at the crossing, about for and , and then grows again with asymptotic slope per share. The headroom thus approaches zero at saturation in relative terms, , which is below for and . Implementations must not assume .
5.7Trading
A trade costs
negative for sells. The program charges a buyer and refunds a seller , rounding in favor of the pool.
(i) For trades from , with ; in particular a round trip has zero cost before fees and rounding. (ii) With rounding in favor of the pool, the vault surplus never decreases, and no sequence of trades that returns to its starting value yields a net profit to the traders involved, taken together.
For , the equation has a unique solution , and
If lies on the collateral grid, the largest grid quantity with is , which bisection over the bracket of Eq. (5.14) finds in a logarithmic number of cost evaluations.
Both proofs are in Appendix B.5. All statements hold in exact arithmetic; Section 6 bounds the effect of the fixed-point approximation .
Buying a complete set of size through the cost function costs , and selling one refunds more than . Any facility that minted complete sets at par and allowed them to be sold into the AMM would let an arbitrageur earn per cycle without information, at the seed provider's expense. From the seed state the overround is constant along , so cycles up to extract exactly . This is a design requirement, not a statement about the program code: complete sets must be obtainable only through the cost function. Fixed-product designs, whose prices sum to one, are by contrast built on par minting (Section 2.6).
5.8Choosing
For a target worst-case loss , Proposition 5.8 fixes independently of and . The parameter then trades off four quantities. (i) The overround, bounded by (Table 5.1). (ii) Depth growth: , so each new outstanding share adds to the liquidity parameter. (iii) Locked seed: , of which only is at risk; smaller locks more collateral. (iv) Numerical range: for the exponent clamp of Section 6 can bind, and the price floor of Table 5.2 falls to the order of the WAD resolution and below.
The default satisfies , so the clamp never binds and every relative weight is at least , well inside WAD precision. For a binary market the maximal overround is percent and falls below 3 percent once (Remark 5.6). The display ceiling is within of one for every , whereas caps the leader's displayed probability at 0.986 for and 0.704 for . With fixed, the binary seed is . The maximal overround grows as , reaching 83 percent for at the default; a target corresponds to , but at even gives 16.6 percent, so the permitted range cannot deliver a small spread for markets with many outcomes. Section 12 compares the LS-LMSR with the LMSR and the CPMM in simulation.
6Fixed-Point Implementation on Solana
This section describes how the Engine II program evaluates the cost function of Section 5 in integer arithmetic, shows that the approximation cannot compromise solvency, and measures its accuracy on a reference emulation of the design written for this paper (Appendix C), not on the program itself.
6.1Number Format and Determinism
State transitions must be bit-identical on every validator, and every
amount that moves collateral must be rounded in a known direction.
Solana supports only a subset of floating-point operations, emulated
in software at higher compute cost
[31], and a
53-bit significand cannot represent every 64-bit token amount, so
directed rounding could not be enforced exactly. Polyquest therefore
uses unsigned 128-bit fixed point with scale
, storing
as
, with hand-written exp and ln. Shares and
balances stay on the collateral grid
, one grid unit being
WAD units, which requires
.
6.2Elementary Functions
Both functions use range reduction followed by polynomial or series
evaluation
[33] (Algorithms C.1
and C.2). For exp we write
with
, reducing at scale
so that the error does not grow with
, evaluate the degree-16 Taylor polynomial of
in Horner form (truncation error below
) and shift by
bits. For ln we write
with
, form
as one rounded quotient () and sum 12 terms of
(truncation error below
). After reduction every product in the Horner loops is below
and fits in 128 bits, and trip counts are fixed, so no input makes
evaluation more expensive.
6.3Stable Evaluation of the Cost Function
Eq. (5.2) cannot be evaluated directly, since reaches at . We factor out the leading outcome:
Each weight
lies in
, the leader's is exactly one, so
, and
by Lemma 5.9.
Algorithm C.3 forms each weight as the
reciprocal
of an exponential with nonnegative argument, after clamping
at
. The constant lies between two limits of the format: at
the reciprocal floors to zero, and near
the WAD value of
overflows 128 bits. The clamp binds only if
, which the allowed range includes. When it binds, the computed
weight is zero, as it already is for every
, while the true weight is below
, less than one WAD unit; the clamp only keeps the argument of
exp in range.
The liquidity parameter , , is never rounded on its own: is the single quotient , which makes exact in integers (Invariant 11.4), and is one rounded quotient of with . Displayed prices, which never move collateral, evaluate Eq. (5.4) in the same weights as .
For every state, holds exactly.
The leader has and exactly, so its weight is and . For , Algorithm C.2 has either and , or and , so it returns at and a nonnegative value above it; the final product is nonnegative.
6.4Rounding Policy and Solvency
The cost of a trade is the difference of two complete evaluations on states. A buy pays , and at least one grid unit; a sell receives and reverts if ; the seed is (Algorithms C.4 and C.5).
Let be any deterministic function of the state with . Under the policy above, every reachable state satisfies .
Initially . A buy raises by at least while rises by exactly ; a sell lowers by at most while falls by exactly . Induction gives , and Lemma 6.1 gives the second inequality.
(i) Any sequence of trades that returns to its starting value leaves the traders with a nonnegative net payment. (ii) Buying in several pieces costs at least , and selling in pieces refunds at most the single-order refund.
(i) Every payment is at least the of its step, and the telescope to because is a function of the state. (ii) The pieces cost , and a grid multiple that is at least a value is at least its ceiling; sells are symmetric.
These results carry Proposition 5.12 over to
integer arithmetic without any error bound in their hypotheses: the
accuracy of exp and ln affects the price a
trader pays, never the vault's ability to pay. They hold for any
implementation that evaluates
on the full state, never incrementally, and satisfies
Lemma 6.1.
6.5Overflow and Headroom
SPL token amounts are 64-bit integers [30], so an amount becomes at most WAD units, the worst case being . Outcome shares are SPL tokens on the same grid, so : a headroom factor of 2.31 below at , and in general ( for a six-decimal stablecoin). Also (factor 4.3) and exponentials stay below . Products of two WAD quantities need not fit in 128 bits ( alone reaches ), so three products use a 256-bit intermediate (mul-div): the exponent numerator , the product and the price accumulator , all at least 1,800 times below . Tokens with very large supplies and any therefore need no special cases.
6.6Outcome Limit
A trade evaluates Algorithm C.3 on the new state, and on the old state unless its value is cached; each evaluation costs exponentials, one logarithm and wide mul-divs. The work is linear in , and the per-transaction compute budget [31], shared with the swap route in swap-to-bet (Section 7.4), limits Engine II on Solana to ; the EVM sibling allows 32. We report no compute-unit measurements of the program. Budget orders (Proposition 5.13) should be solved by the client and enforced by the payment bound rather than bisected on-chain.
6.7Measured Accuracy and Property Tests
We implemented Algorithms C.1 to C.5 as a bit-exact integer emulation in Python that checks every stored value against 128 bits and every wide product against 256 bits. Table 6.1 and Figure 6.1 compare it with mpmath at 50 significant digits on random inputs per routine, drawn across the domain on which each routine is used. These are measurements of the reference emulation, not of the program itself.
| Routine | Inputs | Error metric | Maximum | Mean |
|---|---|---|---|---|
exp (C.1) |
, uniform | relative | ||
| weight (C.3) | , uniform | absolute (ulp) | 1.79 | 0.51 |
ln (C.2) |
, log-uniform | absolute (ulp) | 1.69 | 0.55 |
ln (C.2) |
same, | relative | ||
ln (C.2) |
, uniform | absolute (ulp) | 1.73 | 0.55 |
| round trip | , uniform | absolute (ulp) | 2 | 0.55 |
| round trip | same, | relative | ||
| (C.3) | random states | absolute (ulp) | 8.26 | 0.88 |
| (C.3) | random states with | relative | ||
| (C.4) | one random buy per state | absolute (ulp) | 10.6 | 0.65 |
| random states, maximum over | absolute (ulp) | 10.2 | 1.18 |
exp: relative error
scaled by
; ln: absolute error over the full 128-bit domain;
: absolute error divided by
;
: largest absolute error over outcomes. Reference: mpmath at 50
digits. Measurements of the emulation, not of the program itself.
Random states draw
from 2 to 8;
at the default (10 percent), below
(30 percent) or anywhere in
;
from 0 to 18; seeds from
collateral units upward; and holdings log-uniformly up to the 64-bit
limit in balanced, dominant and one-sided configurations. Thus
spans
to
collateral units, and 9.1 percent of states have a clamped exponent.
Every routine is accurate to a few ulp. The cost error grows with
, which multiplies the error of
; the trade cost error never exceeded
collateral units, below one grid unit of a six-decimal stablecoin
whenever
. Relative errors near a zero of a function reflect output
quantization of half an ulp; for
the largest relative error of ln was
.
Randomized property tests on the emulation used fee rate zero, the least favorable case: 1,118,697 executed trades in 25,000 random markets, including markets pushed toward saturation and toward the 64-bit limit, and 1,037,704 closed cycles and split orders in 26,000 further markets (round trips, multi-leg cycles with partial exits, split buys and sells, and loops of one-unit trades). No test violated , no cycle gave the trader a positive result (the best was exactly zero), no split order beat the single order, no seed loss exceeded , and no 128-bit or 256-bit overflow occurred. Section 11.3 maps these tests to the invariants.
Separately, development verification of the program's on-chain
routines against 40-digit references reported maximum relative errors
of
for exp,
for ln and
for the exp/ln round trip. By
Proposition 6.2 these errors bear on pricing
accuracy only; a relative error of
in
moves the cost by less than one grid unit of a six-decimal stablecoin
whenever
collateral units.
6.8Program Specification
The Engine II program is written with Anchor
[32] for Solana
under program ID
4tjbrvyzZ4PVuCnLKhrbbpcKd4ghnT6xxWPLQ2Mav68z. Its state
accounts are Market, Registry and one
CollateralEntry per accepted mint; its instruction
families cover market initialization (seeding and share-mint setup),
trading, resolution, redemption and registry management. It implements
the cost function, marginal price, trade cost, seed and worst-case
loss, and outcome capacity of Section 5 in the
format described here. The program will undergo an external security
audit after deployment; the analysis in this paper does not depend on
that audit.
7Any-Token Collateral and Swap-to-Bet Execution
Goal G3 has two parts: a market may be denominated in any registered SPL mint, and a trader may pay with a token other than the market's collateral. We describe the collateral registry, the pricing rule used outside the trade path, and the composition of a swap and a trade in one atomic transaction.
7.1Collateral Registry
In the Engine II program, accepted collateral is recorded in a
Registry account and one
CollateralEntry account per accepted SPL mint
[30]. A market's
collateral
is fixed at creation and must have an entry, whether it is a
stablecoin or a community token. Registry management is a separate
instruction family that trades never invoke;
Section 11 treats the authority over it. Engine
I markets are likewise denominated in a single SPL mint chosen at
creation.
7.2Pricing for Display and Creation Gating
The registry applies one pricing rule. USDC and USDT are valued at 1 USD without a price lookup; any other mint is valued through a price source and normalized to USD. A dollar denomination is not a peg: a dollar-denominated token without a 1:1 guarantee, such as USDP (Section 3.2), must be valued through a price source like any other mint if it is registered, and never assumed to be worth 1 USD. The value is used only for display and for creation gating, such as normalizing the value of a seed. It is never an input to a trade: Engine II prices trades solely by the cost function (Section 5), and Engine I by its pools (Section 4).
We keep the oracle out of the trade path for three reasons. First, oracle manipulation cannot be converted into a trading profit against the pool. Second, a stale or unavailable feed cannot halt trading. Third, solvency is a statement in units of (for Engine II, ), so the USD value of does not enter it. A manipulated price at creation can at most admit a thinly seeded market, not an insolvent one.
7.3Swap-to-Bet as One Transaction
A trader holding units of can enter a market in one step. The interface obtains a quote for a Jupiter route from to [28] and sets the enforced minimum output
with converted from basis points to a fraction (rounding up never weakens the bound). Because Jupiter exposes a route as separate compute budget, setup, swap and cleanup instructions together with its address lookup tables [28], the interface can build one transaction containing, in order: compute budget requests; token account setup; the swap leg, which delivers units of to the trader's own account; the trade leg, which spends at most ; and cleanup (Figure 7.1). For Engine II the trade leg buys shares subject to ; for Engine I it stakes an amount fixed at signing, which then equals . Payment tokens are Solana-native assets, such as USDC, USDT, SOL, BONK, wrapped ETH and BTC, and custom SPL tokens.
Assume A1 and A3. For any interleaving of other transactions, a swap-to-bet transaction has exactly one of two effects: (a) it commits, the swap delivered , the trade leg acquired the requested position at cost , and the trader holds that position plus units of ; or (b) it aborts, and all balances are unchanged except for the transaction fee.
Solana executes the instructions of a transaction in order and atomically: if any instruction fails, every state change of the transaction is discarded, while the fee is still charged [31]. The swap leg fails if its output is below (A3), and the trade leg fails if its cost exceeds . If no instruction fails, both bounds held, which is case (a); otherwise case (b) applies.
The worst terms the trader can obtain are thus fixed at signing by , and at no point does collateral pass through an operator account (G1).
7.4Transaction Size and Compute Budget
Legacy and v0 Solana transactions are limited to 1,232 bytes
[31]. Each
account referenced by a legacy transaction costs 32 bytes, so a
multi-hop route plus the accounts of an Engine II trade can exceed the
limit. Versioned (v0) transactions with address lookup tables
reference accounts by a one-byte index
[31], and
Jupiter returns the lookup tables of a route for this purpose
[28]; the
interface must still restrict route complexity so that the composed
message fits. (Solana's newer v1 format raises the size limit to 4,096
bytes but does not support lookup tables
[31].) The
route and the trade also share one compute budget: by default a
non-builtin instruction may use 200,000 compute units and a
transaction at most 1,400,000, and a higher limit must be requested
through the compute budget program
[31]. The
fixed-point exp and ln cost of an Engine II
trade grows with
, which is why Solana markets have
(Section 6); we report no compute measurements of
the program.
7.5Adversarial Ordering and the Collateral Grid
A party that can order transactions around the trader's can move the route's price against it and profit from the reversal, the sandwich pattern studied on Ethereum [34, 35]. By Proposition 7.1, the trader's loss to such a party on the swap leg is at most , and on the trade leg at most , where is the state at quote time. A smaller reduces this exposure but increases the rate of failed transactions under honest price movement; a failed transaction costs only its fee.
Mints differ in their decimals , and all amounts, including and , are integers in base units of . The Engine II program keeps share quantities on the grid and rounds in favor of the pool (Section 6), so a swap-funded buy is settled exactly like any other buy.
8Engine III: Polymarket Order Book Integration
Engine III makes the central limit order book (CLOB) markets of Polymarket available in the Polyquest feed. Polyquest is neither a counterparty nor a custodian in these markets: orders are signed by a wallet that belongs to the individual user and are matched and settled by Polymarket. This section describes Polymarket's design, the integration, and the resulting trust boundary.
8.1Polymarket's Hybrid Exchange
Polymarket operates a hybrid exchange [27]. Orders are EIP-712 typed-data messages signed off-chain by the trader's key; an off-chain operator matches them; and exchange contracts on Polygon (currently CTF Exchange V2) settle matched orders on-chain, verifying each signature and exchanging outcome tokens and collateral in one transaction. Outcome positions are ERC-1155 positions of the Conditional Tokens Framework, in which a complete set of outcome positions can be split from, and merged back into, collateral [24]. Since its April 2026 exchange upgrade (CTF Exchange V2 and CLOB V2), the collateral token is pUSD, an ERC-20 token on Polygon backed by USDC with the backing enforced on-chain, and USDC must be wrapped into it before trading through the API [27].
Two further features matter for an integrator [36]. First, builder attribution: the signed order structure contains a builder code field, so the integrator that routed an order is recorded inside the message the trader signs. Second, a relayer executes gasless transactions for users, including wallet deployment, token approvals, splitting, merging and redemption of positions, and transfers; the relayer pays the Polygon gas and authenticates integrators by API key.
The hybrid design has a well-defined trust profile. The operator controls matching, ordering and inclusion, so it can delay or refuse an order. It cannot execute an order that the trader did not sign, or on terms worse than the signed limit, because the exchange contract verifies both.
8.2Integration Architecture
Figure 8.1 shows the sequence of operations.
- Wallet provisioning. When a user logs in with a Solana wallet, an embedded EVM wallet on Polygon is provisioned for that user through Privy [37]. Privy splits each wallet's key material into a 2-of-2 set of encrypted shares held across separate security boundaries, an enclave share secured by a trusted execution environment and an auth share accessible only with valid authentication credentials, and the complete key exists only temporarily inside the trusted execution environment during a signing operation [37].
- Credentials. Each user receives API credentials of its own for the Polymarket CLOB, bound to the user's embedded wallet address.
- Setup. The relayer performs the one-time on-chain operations, such as wallet deployment and approvals, without the user holding gas tokens.
- Funding. USDC moves from the user's Solana side to the Polygon side through a bridge route (Section 10) and is then converted into Polymarket's collateral as the exchange requires. Direct deposits to the embedded wallet are also supported.
- Trading. The interface builds an order that carries Polyquest's builder code; the user's embedded key signs it, so the order signer is the user's own address; and the order is posted with the user's credentials. Matching and settlement then proceed as in Section 8.1.
- Redemption. After Polymarket resolves a market under its own process, winning positions can be redeemed through a gasless relayer operation.
Signing of the trading wallet is automated: the user does not confirm each order in a wallet prompt. Privy's server-side signing feature, which its documentation calls signers, lets an application request server-side access to a user's wallet; a signer can be scoped by policies to certain transaction types, never sees the wallet's private key, and all signing takes place in the secure enclave [37].
8.3Custody and Trust Analysis
Automated signing changes the custody model relative to Engines I and II, and we state the consequences directly. Because signatures are produced without a per-signature confirmation, the component authorized to request them is inside the trust boundary. Engine III therefore relies on the following parties (assumption A4).
- Embedded-wallet provider. Trusted for key management: the integrity of the trusted execution environment, the storage of key shares and the enforcement of wallet policies. Per its documentation, neither share alone yields the key [37].
- Signing authorization holder. Whichever component holds the authorization for automated signing can obtain any signature that the wallet's policy permits. The design requirement is that this policy be scoped to what Engine III needs: orders from the user's own address and the relayer operations listed above. A policy that also permitted arbitrary transfers would make the holder a de facto custodian. A compromise of one authorization credential could affect every wallet for which it is registered.
- Relayer. Trusted for liveness only. It submits operations that the user's key has signed and cannot forge them; if it fails, gasless operations stall, but funds do not move.
- Polymarket. Trusted for fair matching, for the correctness of its contracts and for resolution under its own process. It cannot fill an order beyond its signed terms.
- Bridge route. Trusted only while funds are in transit (Section 10).
We use a per-user wallet rather than an omnibus account for three reasons. First, funds are never pooled: each user's collateral and positions sit at an address associated with that user, so there is no commingled balance whose loss would be shared and no internal ledger that must be reconciled against an on-chain total. Second, attribution is exact: every order, fill and position is on-chain under the user's own address, and the builder code in each signed order attributes routed volume to Polyquest without Polyquest ever acting as an intermediary. Third, the design matches G1 in spirit: Polyquest takes no deposit and is not a counterparty. The honest qualification is that per-user wallets bound the commingling of funds, not the blast radius of a shared signing authorization; that bound comes from the policy scope above, and Section 11 analyzes it.
9Market Lifecycle and Resolution
Engine I and Engine II markets follow one lifecycle on Solana, shown in Figure 9.1: creation, open trading, close, resolution and redemption. Engine III markets are created, traded and resolved by Polymarket; Polyquest lists them and routes orders but does not drive their lifecycle.
9.1Creation
Any wallet can create a market (G2). The creator fixes the following parameters at creation:
- the engine (I or II);
- the outcomes , with for Engine II on Solana;
- the collateral mint , which must be registered (Section 7.1);
- for Engine II, the liquidity-sensitivity parameter and the seed , which determine the seed collateral and the loss bound (Section 5);
- the fee rate with shares (Section 13);
- the rules text, which defines each outcome and the edge cases, and the resolution source;
- the close time ;
- the designated resolver role.
For Engine II, initialization posts into the market vault and sets up one share mint per outcome. Creation gating may use the display price of to normalize the value of the seed (Section 7.2); apart from display, this is the only point in the lifecycle at which a price feed is consulted.
9.2Trading and Close
While the market is open, Engine I accepts stakes into outcome pools, and Engine II accepts buys and sells priced by at any time. Trading ends at in both engines. The close time should precede the moment at which the outcome becomes publicly observable. Otherwise a trader who has already observed the outcome can buy the winning outcome from the Engine II market maker at a price below its settlement value of one collateral unit, which transfers the seed to that trader up to the bound , or can dilute a winning Engine I pool with near-certain information.
Live, minute-scale Polyquest Originals, which are shown alongside a broadcast, are the same lifecycle with a short window between opening and . Nothing in the state machine changes, but the requirement on becomes tight: the market must close before the broadcast reveals the outcome, and any delay between the event and its broadcast must be accounted for when is set.
9.3Resolution
After , the designated resolver reports the realized outcome according to the market's rules and resolution source, and the program records it; from then on the outcome is final and redemption is enabled. We specify the resolver only as a role with assumption A2: correctness of every payout depends on the resolver's report, and the program cannot verify it.
The design space for this role is well studied. A designated resolver is a single named party; it is fast and simple, and its trust is concentrated. An optimistic oracle accepts a proposed outcome unless it is disputed within a window, with bonds at stake, and escalates disputes to a separate process [38]; it trades latency for weaker trust. A committee requires a threshold of independent reporters to agree, which spreads trust at the cost of coordination. The appropriate choice depends on the market's horizon: minute-scale markets need resolution within minutes, while long-horizon markets can tolerate dispute windows.
9.4Redemption
Redemption follows the engine's payout rule. In Engine II, each winning share redeems for exactly 1 collateral unit, and shares of losing outcomes redeem for nothing. In Engine I, each trader in the winning pool claims of Eq. (4.1). In Engine III, positions resolve under Polymarket's own process and are redeemed on Polygon (Section 8.2).
9.5Ex Post Quality Control
Because market creation is permissionless, quality is controlled after the fact rather than by listing approval: through curation, volume ranking, creator reputation, and the creation collateral or seed that a creator must commit. These mechanisms affect what the interface surfaces. They do not restrict who can create a market or trade in it on-chain, and a market's rules, once created, bind its resolver and its payouts regardless of how it is ranked.
9.6Creator Curation
Creators take part in two ways. As market creators (Section 9.1), they open Engine I and Engine II markets on questions their audiences already follow, so a new market arrives with participants who hold views on it. Such a market supplies both the question and part of the informed flow that aggregation requires (Section 2.1), which addresses the cold start of Section 4.4 from the demand side.
As curators, creators select existing markets, including Polymarket markets listed through Engine III, and publish them as curated lists for their followers. A curated list records the creator's evaluation: the markets the creator considers worth attention. The Polymarket catalog alone is far larger than a retail user can search, and a list from a creator the user already follows reduces that search to a handful of markets with a stated rationale.
Curation is a discovery layer and changes nothing below it. A curated list references markets; their pricing rule, collateral, resolution and settlement remain those of the underlying engine, and following a list moves no funds. Curation therefore adds no custody or solvency assumption. It does add an informational one, because a curator may curate carelessly or hold positions in the markets it recommends. We state two design requirements: every curated list is attributed to its curator, and the interface presents a curation as the curator's opinion rather than as a verified assessment. Curation is also one of the ex post quality controls of Section 9.5.
10Cross-Chain Access
Polyquest markets settle on Solana (Engines I and II) or on Polygon (Engine III), but users hold assets on many chains. We separate cross-chain movement from trading: bridging is a funding step that happens before a trade and outside its transaction, and no market state depends on a cross-chain message.
Inbound assets. The "My page" area integrates the Mayan bridge so that users can bring assets from other chains into their Solana wallet [29]. Mayan offers several routes. In its auction-based route (Swift), the user locks the input on the source chain and signs an order; competing solvers (drivers, in Mayan's terminology) bid, in an auction held on Solana, on the output they can deliver; the winning solver delivers the output on the destination chain from its own liquidity; and a cross-chain message then releases the locked input to the solver on the source chain. If an order is not fulfilled, the user is refunded [29]. Once the assets arrive, they are ordinary SPL tokens in the user's wallet and can be used directly or through swap-to-bet (Section 7), which itself uses only Solana-native assets.
Funding Engine III. USDC moves from the user's Solana side to the embedded wallet on Polygon through a bridge route, after which it is converted into Polymarket's collateral (Section 8.2).
Trust assumptions. A bridge adds its own assumptions: the correctness of its contracts on both chains, the integrity of the messaging layer that attests to events on the source chain, and, for solver-based routes, the liveness of at least one solver, without which funds are delayed until a refund. Because bridging is outside the trade path, these assumptions affect only funds while they are in transit, and a bridge failure cannot corrupt the state or solvency of a Polyquest market. A user who already holds assets on Solana never relies on a bridge for Engines I and II. We do not model bridge security further in this paper.
11Security Analysis
This section states the adversary model, enumerates threats across the three engines, and collects the invariants of Engine II. A claim is supported by a proof about the mechanism (Sections 5 and 6, Appendix B), by randomized tests of the reference emulation of Section 6, or is marked as a design requirement that this paper does not verify against the program code. None of these arguments relies on an audit or on formal verification of the program (Section 14).
11.1Adversary Model and Assets
Assets. Per Engine I or II market: the vault balance , the seed , traders' shares or stakes, and fee balances. Platform-wide: the parameters fixed at creation (rules, resolution source, close time, resolver), the collateral registry, the program code, users' embedded EVM wallets and their credentials, and funds in transit on bridges.
Adversary. The adversary controls any number of Solana wallets, creates markets with any parameters inside the protocol bounds, trades in every engine before close, and observes and reorders pending transactions to the extent that searchers and block producers can [34, 35]. It may control the mint of a collateral token and move the price reported by an external feed. The designated resolver (A2), the holders of the upgrade and registry authorities (Remark 3.2), Solana (A1), Polymarket, the embedded-wallet provider and bridges are dependencies whose failure we analyze but do not prevent. Consensus-level attacks are out of scope.
11.2Threats and Mitigations
In Table 11.1, entries marked requirement are design requirements rather than verified properties of the program code.
| Threat | Engine | Mitigation | Residual risk |
|---|---|---|---|
| Price manipulation in thin markets | I, II | Moving a price costs collateral and loses in expectation to informed traders [14]; depth grows with interest (Proposition 5.4) | Small markets' displays move cheaply |
| Close-time manipulation | I, II | Payoffs depend only on , not on the closing price; trading ends at | Misleading final display; no payoff effect |
| Wash trading to farm creator fees | II | Costs at least per unit of volume (Remark 13.2) | Inflated rankings; requirement: rank on volume net of self-trades |
| Misleading or conflicted curation | I, II, III | Curation never changes pricing, collateral or settlement (Section 9.6); requirement: lists attributed to their curator and presented as opinion | Followers act on a careless or biased signal |
| Sandwiching the swap leg of swap-to-bet | I, II | Enforced minimum output in one atomic transaction (Proposition 7.1) | Loss up to per transaction |
| Front-running an Engine II trade | II | Payment bound and refund bound (Algorithms C.4, C.5) | Loss up to the bound set by the trader |
| Rounding and dust exploitation | II | Buy rounded up with a one-unit minimum, sell rounded down; no profitable cycle or split (Propositions 6.2, 6.3) | None found in property tests |
| Overround extraction via par complete-set minting | II | Requirement: complete sets only through the cost function (Remark 5.14) | None if the requirement holds; otherwise up to per market |
| Parimutuel last-moment entry | I | Close time before the outcome is observable (Section 9.2) | Informational advantage of late entrants (Section 4.3) |
| Resolver misreporting | I, II | Rules, source and resolver fixed at creation; public, attributable report; reputation (Section 9.5) | Trust in the role (A2); a false report misallocates the vault |
| Price-feed manipulation | I, II | Oracle not in the trade path (Invariant 11.5) | Distorted display and creation gating; thin, never insolvent markets |
| Hazardous SPL mint | I, II | Requirement: registry admission rules (below) | Collateral value risk; issuer freeze of a vault |
| Registry or upgrade authority misuse | I, II | Trades never invoke registry instructions (Section 7.1) | Trust in the authority holders (Remark 3.2) |
| Bridge failure | III, funding | Bridging is outside every trade transaction (Section 10) | Loss or delay of funds in transit |
| Embedded wallet and automated signing | III | Per-user keys; requirement: signing policy scoped to orders and relayer operations (Section 8.3) | Provider compromise; a shared authorization credential spans many wallets |
| Relayer outage | III | Relayer cannot forge operations (Section 8.3) | Liveness: gasless operations stall |
| Polymarket platform and resolution | III | None within Polyquest; markets tagged by engine | Full dependence on Polymarket's matching and resolution |
| Compute exhaustion | II |
; fixed trip counts in exp and
ln (Appendix C)
|
Transaction failures under network congestion |
Three rows need comment. Complete sets. Because everywhere (Proposition 5.5), par minting of complete sets would let anyone sell the overround into the pool without information; from the seed state such cycles extract exactly (Remark 5.14). Price feeds. A manipulated feed can mislead the USD display or let a creator pass a USD-denominated seed gate with fewer tokens than intended, but cannot touch solvency, which is stated in units of (Section 7.2).
Token hazards. Several mint features would break the accounting of Section 6 or the redemption guarantee, and we state the following registry admission rules as design requirements. (i) No extension that alters transfer semantics: a transfer fee makes the vault receive less than the amount credited to ; a transfer hook runs arbitrary code on every transfer and can block redemption; a permanent delegate can move vault funds; a default-frozen account state can block settlement [30]. (ii) A freeze authority is accepted only for issuers whose freeze policy is known, such as the major stablecoins, and the residual risk that an issuer freezes a vault is disclosed. (iii) Decimals satisfy , so that the collateral grid is no finer than the WAD grid. Supply needs no rule, since every 64-bit amount fits the arithmetic with headroom (Section 6.5). An active mint authority can inflate supply and erode the collateral's value, which harms participants but not solvency in token units.
11.3Invariants
Each invariant of Engine II below is followed by its argument and by the property test of Section 6.7 that exercises it. The tests ran on the reference emulation, with 1,118,697 executed trades in 25,000 random markets and 1,037,704 closed cycles and split orders in 26,000 more, covering from 2 to 8, across with 30 percent of markets below , and decimals from 0 to 18; no invariant was violated.
After every trade, .
Proposition 6.2 gives in integer arithmetic, whatever the error of (Proposition 5.7 in exact arithmetic). Tested after each of the 1,118,697 trades.
For every reachable state and every outcome , the seed position loses at most , fixed at market open.
The seed shares redeem for and any residual claim is nonnegative by I1 (Proposition 5.8). Tested for every outcome after every trade (5,740,283 checks). The integer exceeded by less than one grid unit, up to a numerical deviation below . The largest observed loss equaled to double precision: for , a market driven to one outcome has vanishing clamped weights and , so the bound is tight.
Every trade satisfies : buys pay with a minimum of one grid unit, and sells receive .
This holds by construction of Algorithms C.4 and C.5; by Proposition 6.3 no cycle or split order profits the trader. Tested on 1,037,704 cycles and split orders (round trips, multi-leg cycles, split buys and sells, and dust loops); the largest trader result was zero.
Every exponent passed to exp satisfies
.
Lemma 5.9 gives in exact arithmetic; Algorithm C.3 rounds down from one exact quotient and then clamps it, so the bound holds exactly in integers. Checked for every outcome of every state; the clamp was active 162,086 times.
Trade costs and refunds are functions of only.
This is a design property of the Engine II program (Section 7.2). The emulation's trade routines take no price input, so the invariant is structural rather than tested.
After resolution, each winning share redeems for exactly one collateral unit.
This is the redemption rule of the Engine II program (Section 9.4). With I1, the vault can redeem all winning shares for any ; the tests of I1 and I2 check this for every candidate outcome.
12Evaluation by Large-Scale Simulation
This section evaluates Engine II by Monte Carlo simulation. Every number below is a simulation result produced by the accompanying code under the configuration of Appendix E; none is a measurement of the Engine II program or of live markets. The four experiments comprise simulated trades in 100,000 LS-LMSR markets, trades in single-market paths that each reach USD of notional volume, and simulated trading decisions in an aggregation study. Together these runs carry about USD of simulated notional volume.
12.1Research Questions and Setup
We ask four questions. RQ1 (price impact): how does the average execution price of a single order depend on its size? RQ2 (liquidity sensitivity): how does depth evolve as a market accumulates volume? RQ3 (solvency and bounded loss): do the invariants of Section 5 hold at scale under adversarial flow, and how close does the realized seed loss come to ? RQ4 (information aggregation): how accurate and calibrated are final prices when all mechanisms receive the same informed flow?
We follow earlier comparisons of automated market makers by liquidity and accuracy [26]. The LS-LMSR of Othman et al. [10] follows Eqs. (5.1) and (5.2), seeded at with . We evaluate relative to the leading outcome, , and prices by Eq. (5.3). Against an 80-digit reference, the largest relative price error of Eq. (5.3) was ; Eq. (5.4) had a similar absolute error (), which becomes a large relative error for prices near the floor of Proposition 5.10, so we use Eq. (5.3) throughout. Orders are specified in collateral and converted to shares by a safeguarded Newton iteration; the cost charged is always the exact difference , so solver tolerance affects order size but never the vault accounting.
The benchmarks are an LMSR with constant chosen so that (equal worst-case loss); a binary constant-product pool in the style of fixed-product market makers [22, 23], in which the seed mints complete sets, the pool holds reserves of the two outcome shares, a buy of the first outcome with collateral mints complete sets, adds them to the pool and pays out first-outcome shares until is restored, and the displayed price is (a benchmark model with par minting, not part of Polyquest); and the parimutuel pools of Section 4 with . The pool's worst-case loss is its whole seed , so we also report it with reserves equal to . No experiment charges fees, gas or priority fees.
12.2Price Impact of Single Orders (RQ1)
A binary market with USD receives one buy of the first outcome, from 10 USD to USD on a grid of 281 sizes. We report the slippage of the average execution price relative to the pre-trade marginal price and the premium relative to the pre-trade displayed probability . For the LS-LMSR the two references differ: at the seed state the marginal price is and the displayed probability is (Propositions 5.2 and 5.5).
| Mechanism | Worst-case loss (USD) | Order for +1 pp (USD) | Slippage at | Slippage at | Slippage at | Premium at | Premium at |
|---|---|---|---|---|---|---|---|
| LS-LMSR, | 13,673 | 410 | 7,367 | 9,460 | 9,700 | 382 | 9,730 |
| LS-LMSR, | 33,496 | 1,046 | 4,930 | 8,704 | 9,266 | 446 | 9,352 |
| LS-LMSR, | 64,822 | 2,165 | 3,075 | 7,567 | 8,583 | 743 | 8,784 |
| LS-LMSR, | 121,751 | 4,622 | 1,688 | 5,741 | 7,354 | 1,411 | 7,923 |
| LS-LMSR, | 217,073 | 10,428 | 822 | 3,551 | 5,372 | 2,785 | 7,308 |
| LMSR, equal loss to | 64,822 | 1,889 | 3,586 | 8,783 | 9,871 | 53 | 8,783 |
| CPMM, same seed | 1,000,000 | 20,204 | 476 | 3,333 | 8,333 | 5 | 3,333 |
| CPMM, equal loss to | 64,822 | 1,310 | 4,355 | 8,852 | 9,872 | 77 | 8,852 |
At every order size, slippage falls monotonically in . At USD it is 7,567 basis points for the default , against 8,783 for the equal-loss LMSR and 3,333 for the same-seed CPMM; at USD the figures are 8,583, 9,871 and 8,333. The comparison with the CPMM is not like for like: its seed is fully at risk, 15.4 times the LS-LMSR's , and at equal worst-case loss the CPMM is the most expensive of the three at USD (8,852 basis points).
Panel (b) shows the other side. Because the LS-LMSR quotes the overround, small orders pay a premium close to the maximal overround (693 basis points for ): 743 basis points at USD, against 53 for the equal-loss LMSR. On the whole grid and for every , the LS-LMSR premium was at least that of the LMSR with the same worst-case loss (up to basis points of rounding), while its slippage relative to its own marginal price was always lower; for the two premiums differ by 2 basis points at USD and by less than 0.1 at USD. For a single order from the seed state, liquidity sensitivity therefore does not lower the all-in cost; it raises the resistance of the displayed probability (2,165 USD against 1,889 USD for one percentage point at ). Its benefit lies in how depth develops with volume.
12.3Depth Under Sustained Flow (RQ2)
A binary market with USD and (, USD) receives market orders with log-normal sizes (median 1,000 USD) on a random side until its cumulative notional reaches USD, about 606,800 orders under buy-only flow. In the mixed flow 30 percent of orders are sells. The LMSR with receives the identical order sequence. We measure as the smaller of the collateral amounts that move the leading displayed probability up or down by one percentage point, over eight replicate paths per case.
Initial depth is similar (21.6 USD for the LS-LMSR, 18.9 USD for the LMSR). The LS-LMSR depth then grows in proportion to volume, as Proposition 5.4 predicts: its median reaches 1,987 USD at USD of volume and USD at USD, and USD under mixed flow. The LMSR depth stays at 9.4 USD: orders of about one push its price to the extremes, where the median leading probability at the end of the paths was 0.999. An LMSR matching the final LS-LMSR depth at would need , a worst-case loss of USD committed at opening instead of 648 USD.
This depth is paid for by traders. With zero fees, the seed position of the LS-LMSR ended every buy-only path with a gain between and USD whichever outcome won (about 6.5 percent of volume), and between and USD under mixed flow; this is the counterpart of the premium in Table 12.1. The LMSR seed position, which collects no overround, lost a median of 648 USD, essentially , under the unfavorable outcome. Section 13 discusses seed-provider economics; these simulated transfers scale with the assumed flow and are not a forecast.
12.4Solvency and Bounded Seed Loss at Scale (RQ3)
We simulate markets with , uniform on and seeds log-uniform on USD, for trades each. Noise traders buy or sell random outcomes with sizes from a log-normal body and a Pareto tail; informed traders buy the outcome whose displayed probability is furthest below the latent ; adversarial traders buy the eventual winner in large one-directional orders, which raises the seed loss until and drives markets to saturation. One fifth of the markets are adversarial, with half of their flow adversarial; in the others 5 percent of the flow is. After every trade we check with the vault accumulated from charged costs, the seed-loss bound of Proposition 5.8, and the overround bounds of Proposition 5.5, with a relative tolerance of and also strictly. A second vault adds (four units of double-precision machine epsilon) to every buy and subtracts it from every refund, a floating-point stand-in for the pool-favoring rounding of Section 6.4.
| Quantity | Simulated value |
|---|---|
| Trades (buys, sells) | 100,000,000 (78,306,226; 21,693,774) |
| Notional volume | USD ( adversarial) |
| Violations at tolerance (all four checks) | 0 |
| States with strictly: / | 790 (at most relative) / 0 |
| States with strictly: Eq. (5.3) / Eq. (5.4) | 2 / 12,586 (at most / below 1) |
| States with strictly: Eq. (5.3) / Eq. (5.4) | 4 / 1,438 (at most / ) |
| Largest seed loss over all states, : / | / |
| Markets with a seed loss at settlement (base, adversarial) | 20.3% (18.3%, 28.4%) |
| Seed-position result at settlement, : minimum, 1st percentile | , |
| States with (largest price) | 345,386 (1.0084) |
| States in which the clamp would bind | 39,007 (0.54% of states with ) |
No invariant failed at tolerance. The strict deviations are rounding at the level of one to a few units in the last place; the lower overround bound, which Proposition 5.5 states as strict, was crossed only by this rounding, and far more often with Eq. (5.4) than with Eq. (5.3). The pool-favoring accumulator removed every solvency deviation, as Proposition 6.2 predicts for integer arithmetic.
The seed-loss bound is approached but, for large , not reached. Since for and seed shares are never sold, the smallest capacity over reachable states lies on the path , along which is convex with minimum where (see the discussion after Proposition 5.11). The attainable seed loss is therefore with . We computed , , and . Figure 12.3 shows that every simulated market stays below its curve (the largest ratio to was , again rounding), and the closest markets with come within of it.
The loss side of the settlement distribution is bounded as designed: the worst seed-position result was , in a market with and where . In the other 79.7 percent of markets the overround collected on the simulated flow, whose notional exceeded the seed by a median factor of 41, produced a gain. We report this sign pattern but do not interpret the size of the gains, which scale with the assumed flow.
12.5Information Aggregation (RQ4)
Each of the four mechanisms runs the same 10,000 binary markets with USD and 1,000 arriving traders, trading decisions in total, with common random numbers. The latent is uniform on and the outcome is drawn from it. A trader believes with , holds a log-normal budget (median 100 USD) and trades once, myopically: in the cost-function markets and the CPMM it buys a side whose marginal price is below its belief for that side until the two are equal or the budget is spent; in the parimutuel it stakes on the underpriced side the amount that moves to its belief, within budget. We score the final displayed probability by the Brier score [16, 15] and by .
| Mechanism | Brier | MAE | Slope | MAE after 10 / 100 / 1,000 arrivals | Trades executed |
|---|---|---|---|---|---|
| LS-LMSR () | 0.1813 | 0.0769 | 0.72 | 0.097 / 0.081 / 0.077 | 8,975,962 |
| LMSR (equal loss) | 0.1863 | 0.0861 | 0.79 | 0.094 / 0.088 / 0.086 | 10,000,000 |
| CPMM (same seed) | 0.1812 | 0.0731 | 0.74 | 0.199 / 0.080 / 0.073 | 10,000,000 |
| Parimutuel | 0.1795 | 0.0709 | 0.73 | 0.202 / 0.094 / 0.071 | 10,000,000 |
Because the markets share their random numbers, we compare them by paired per-market differences. The LS-LMSR is more accurate than the equal-loss LMSR: its Brier score is lower by 0.0050 (standard error 0.0008) and its MAE by 0.0092 (0.0007), since its depth grows with volume and later prices reflect more signals, and it converges about as quickly over the first ten arrivals (Figure 12.5). Its Brier score is indistinguishable from that of the same-seed CPMM (difference 0.0001, standard error 0.0001), but its MAE is higher by 0.0038 (0.0001); the parimutuel pool, whose ratio is a stake-weighted average of all past beliefs, is ahead by 0.0018 (0.0002) in Brier score and 0.0060 (0.0003) in MAE. Both start slowly: the CPMM because its seed is deep relative to budgets, the pool because its seed stakes dominate early. At equal worst-case loss the CPMM (MAE 0.089) ranks below the LS-LMSR. In 10.2 percent of LS-LMSR decisions the belief fell inside the overround band and the trader did not trade. The ordering of the LS-LMSR against the LMSR is unchanged at belief noise 0.5 and 2.0.
All four mechanisms compress prices toward (slopes 0.72 to 0.79), which appears as under-confidence in Figure 12.4. This is a property of the trader model: a trader who moves the price to its own noisy belief moves it toward , whose mean lies closer to than , and no trader conditions on the price. The same model yields a mild early-entry effect in the parimutuel pool: the expected payout multiple under is 1.036 for the first tenth of arrivals and 0.999 for the last. Late entrants in our model observe better pools but hold no better signals, so the late-entry advantage of Section 4.3 requires informational differences that we do not model.
12.6Threats to Validity
Arithmetic. We use IEEE double precision; the program uses WAD fixed point with directed rounding, an exponent clamp and a collateral grid (Section 6). Our pool-favoring accumulator only imitates that policy, and we report how often the clamp would bind rather than applying it. Omitted costs. There are no fees, gas, priority fees or MEV [34]; front-running and sandwiching (Section 11) are not modeled. Trader models. All traders are stylized: exogenous arrival, myopic behavior, no learning from prices, and an adversary that knows the outcome. Absolute accuracy levels in Table 12.3 depend on these choices; the comparison under common random numbers is the object of interest. Parameters. Seeds, flow distributions, budgets and the matching rules for the benchmarks are our choices, and rankings can change with them, as the two CPMM variants show. Benchmarks. The CPMM and parimutuel models are textbook versions, not the code of any other protocol. Independence. Markets are simulated independently, without cross-market arbitrage.
13Fee Design and Protocol Economics
This paper does not cover token design, and none of its results depends on a token. The mechanisms analyzed here rely on one economic instrument: a per-market trading fee, split between the market's creator and the protocol. We state where each engine charges the fee, derive the worst-case economics of a creator who seeds an Engine II market, and explain why fee sharing makes creator acquisition a variable cost. All results are symbolic in the fee parameters.
13.1Fee Rate and Where It Is Charged
Each market carries a fee rate chosen by its creator (Section 9.1), with protocol-wide bounds. Fee proceeds are split as between the creator and the protocol, with .
Engine II. In the reference design of Appendix C, the fee is charged on the trade cost: a buy pays into the vault plus a fee of rounded up to the grid, and a sell pays the same rate on its refund (Algorithms C.4 and C.5). This explicit fee comes in addition to the implicit overround of Section 5.4, which accrues to the vault rather than to the fee recipients. Fees are held outside , so the solvency argument of Proposition 6.2 does not rely on fee income.
Engine I. The fee is charged on the losing side at resolution and equals (Proposition 4.2); a one-sided pool pays no fee.
Engine III. Orders carry Polyquest's builder attribution under Polymarket's builder program [36]. The economics of routed volume are set by that program's terms, not by the parameters above, and we do not model them.
13.2Seed-Provider Economics
In Engine II the creator posts the seed with (Proposition 5.8), and by Invariant 11.2 the seed position never loses more than . Two sources offset this loss. The market maker's result improves on the worst case by the capacity (Proposition 5.8), which is homogeneous of degree one and exceeds once outstanding interest is large enough in a given direction (Section 5.5); and the creator earns on every trade. Let denote a market's traded volume in collateral units before fees, measured as the sum over trades of the grid amounts paid into or refunded from the vault (Algorithms C.4 and C.5).
Let a creator seed an Engine II market with per outcome and receive the fee share . For every trade path and every realized outcome, the creator's net result satisfies
In particular, whenever
The seed position pays and holds shares of every outcome, which redeem at one collateral unit each for the winning outcome (Invariant 11.6); any claim on the residual is nonnegative by Invariant 11.1. The seed position therefore returns at least . Fees are rounded up and held outside , so the creator's fee income is at least . Adding the two parts gives Eq. (13.1); setting its right side to zero gives Eq. (13.2).
The bound is conservative: it ignores the capacity and assumes the worst outcome for the seed. Per unit of seed, the threshold is , where is the maximal overround of Table 5.1; at the default it equals for a binary market and for .
A creator who trades with itself pays on each leg and recovers . A round trip returns the state to its start, so by Proposition 6.3 the vault legs cannot profit the trader, and the net cost per unit of wash volume is at least . Wash trading is thus unprofitable whenever , although it can still distort volume-based ranking (Table 11.1).
13.3Creator Acquisition as a Variable Cost
Permissionless creation (Section 9.1) makes the supply of markets depend on creators' incentives. A fixed payment per created market would reward markets that attract no trading and invite Sybil creation at the protocol's expense. The share instead ties every payment to realized volume: an untraded market costs the protocol nothing, and the payment is funded by traders' fees rather than by the protocol's balance sheet, with remaining as protocol revenue on the same volume. Curation (Section 9.6) extends the creator's role to markets it did not open: a creator can direct followers to existing markets, including Polymarket markets, without posting a seed. The seed complements this by putting the creator's own capital at risk up to , and Proposition 13.1 states how much volume makes that risk worthwhile. None of the results in this section relies on emissions, buybacks, points or any other token-based incentive.
14Limitations and Future Work
We close the technical part of the paper by stating what it does not establish and which extensions we consider most important.
Resolution trust. Every payout in Engines I and II depends on the report of a market's designated resolver (assumption A2), and the program cannot verify that report. Section 9.3 outlines the design space; moving from a designated resolver toward an optimistic oracle with disputes [38], or toward a committee, would replace trust in one party with economic and procedural assumptions whose latency must fit markets that close within minutes. We do not specify such a mechanism in this paper.
Verification and audit. The Engine II program will
undergo an external security audit after deployment, and this paper
does not rely on that audit or on formal verification. The invariants
of Section 11.3 rest on proofs about the
mechanism, on randomized tests of a reference emulation, and on
development verification of the program's arithmetic, not on a proof
about the program code. Beyond the planned audit, natural next steps
are differential testing of the program's routines against the
reference emulation of Appendix C, and
machine-checked proofs of Propositions 6.2 and
6.3 in integer arithmetic, which require only the structural
properties of Lemma 6.1 rather than error
bounds for exp and ln. Our accuracy results
for those functions are sampled measurements, not proven bounds.
Outcome limit. Solana markets are limited to outcomes by the compute budget, while the EVM sibling implementation allows 32. Events with many outcomes must currently be split into several markets, which loses the joint pricing that a single cost function provides. Combinatorial designs [17] and cheaper evaluation of are open directions.
Fixed liquidity sensitivity. Each market fixes at creation, and Section 5.8 shows that no single value serves all : the maximal overround grows as . Schemes that adapt liquidity to volume or to time remaining, and alternative market makers such as pm-AMM [25], which targets uniform loss to arbitrageurs across prices and over time, could be compared with the LS-LMSR within the simulation framework of Section 12.
Cross-engine arbitrage and routing. The same event can be listed as an Engine II market and as a Polymarket market in Engine III. Their prices can diverge, and an order router could split a trade between the cost function and the order book. Arbitrage between them crosses chains and, more importantly, resolution processes: the two markets may resolve differently, so such positions carry basis risk that a router must expose to the user.
Derivatives on positions. Outcome shares have payoffs bounded in collateral units, which makes them candidates for use as collateral in margin trading or position-collateralized lending. The main difficulty is the jump of a share's value to 0 or 1 at resolution, which requires liquidation rules that anticipate the close time rather than react to prices.
Empirical validation. All quantitative results on market behavior in this paper come from simulation (Section 12) or from exact and fixed-point computation. Validating forecast accuracy, depth and seed-provider outcomes on live market data is future work.
15Conclusion
Polyquest addresses four frictions of long-tail prediction markets (single collateral, custody, curated supply and missing liquidity) by composing three market engines behind one self-custodial interface on Solana. Each engine covers a regime in which the others are weak: parimutuel pools need no seed and suit community markets in custom tokens, the LS-LMSR quotes at every moment with a loss bound fixed at market open, and the Polymarket order book supplies external depth for widely followed events. A creator layer on top of the engines lets creators bring their audiences to the markets they open and curate existing markets, including Polymarket markets, for their followers.
For the LS-LMSR we established the properties on which the Engine II
program relies: prices decompose into LMSR weights plus a common
entropy surcharge, the overround lies between an explicit lower bound
and
, the vault always covers the winning liability, and the seed
provider cannot lose more than
. We showed that these guarantees survive integer arithmetic: with
rounding in favor of the pool, solvency and the absence of profitable
cycles hold for any deterministic approximation of the cost function
that dominates the largest liability, whatever the accuracy of
exp and ln. Composing a swap and a trade in
one atomic transaction lets traders pay with another Solana-native
asset while price feeds stay outside the trade path.
The simulation study supports these results at scale and also marks their limits. Across simulated trades no invariant was violated at a relative tolerance of , and depth grew in proportion to volume as the theory predicts. The same study shows that liquidity sensitivity does not make a single order cheaper than an equal-loss LMSR from the seed state, and Section 5 shows that the overround becomes large for markets with many outcomes. The most important open problems are decentralized resolution with latency suitable for minute-scale markets, external audit and machine-checked proofs of the integer invariants, and empirical validation on live market data.
References
- Justin Wolfers and Eric Zitzewitz. 2004. Prediction Markets. Journal of Economic Perspectives 18, 2 (2004), 107–126. https://doi.org/10.1257/0895330041371321
- Kenneth J. Arrow, Robert Forsythe, Michael Gorham, Robert Hahn, Robin Hanson, John O. Ledyard, Saul Levmore, Robert Litan, Paul Milgrom, Forrest D. Nelson, George R. Neumann, Marco Ottaviani, Thomas C. Schelling, Robert J. Shiller, Vernon L. Smith, Erik Snowberg, Cass R. Sunstein, Paul C. Tetlock, Philip E. Tetlock, Hal R. Varian, Justin Wolfers, and Eric Zitzewitz. 2008. The Promise of Prediction Markets. Science 320, 5878 (2008), 877–878. https://doi.org/10.1126/science.1157679
- PYMNTS. 2026. Bernstein Predicts $1 Trillion in Prediction Market Volume by 2030. PYMNTS.com (April 15, 2026). https://www.pymnts.com/economy/markets/2026/bernstein-predicts-1-trillion-in-prediction-market-volume-by-2030/
- DeFi Rate. 2026. Prediction Market Volume Data (30-day volume). https://defirate.com/prediction-markets/. Accessed September 26, 2026.
- CoinDesk. 2026. 2026 FIFA World Cup Saw $20 Billion in Prediction Market Volume (citing Chainalysis). CoinDesk (July 31, 2026). https://www.coindesk.com/markets/2026/07/31/world-cup-bets-smash-records-as-prediction-markets-hit-usd20-billion-in-volume
- Commodity Futures Trading Commission. 2026. CFTC Seeks Public Comment on Notice of Proposed Rulemaking Concerning Event Contracts Involving Enumerated Activities. Press Release 9249-26 (June 10, 2026). https://www.cftc.gov/PressRoom/PressReleases/9249-26
- Robin Hanson. 2007. Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation. The Journal of Prediction Markets 1, 1 (2007), 3–15. https://doi.org/10.5750/jpm.v1i1.417
- Richard H. Thaler and William T. Ziemba. 1988. Anomalies: Parimutuel Betting Markets: Racetracks and Lotteries. Journal of Economic Perspectives 2, 2 (1988), 161–174. https://doi.org/10.1257/jep.2.2.161
- Anatoly Yakovenko. 2018. Solana: A New Architecture for a High Performance Blockchain v0.8.13. Whitepaper. https://solana.com/solana-whitepaper.pdf
- Abraham Othman, David M. Pennock, Daniel M. Reeves, and Tuomas Sandholm. 2013. A Practical Liquidity-Sensitive Automated Market Maker. ACM Transactions on Economics and Computation 1, 3, Article 14 (September 2013), 25 pages. https://doi.org/10.1145/2509413.2509414
- Joyce Berg, Robert Forsythe, Forrest Nelson, and Thomas Rietz. 2008. Results from a Dozen Years of Election Futures Markets Research. In Handbook of Experimental Economics Results, Vol. 1, Charles R. Plott and Vernon L. Smith (Eds.). Elsevier, Amsterdam, Chapter 80, 742–751. https://doi.org/10.1016/S1574-0722(07)00080-7
- Charles F. Manski. 2006. Interpreting the Predictions of Prediction Markets. Economics Letters 91, 3 (2006), 425–429. https://doi.org/10.1016/j.econlet.2006.01.004
- Michael Ostrovsky. 2012. Information Aggregation in Dynamic Markets with Strategic Traders. Econometrica 80, 6 (2012), 2595–2647. https://doi.org/10.3982/ECTA8479
- Robin Hanson and Ryan Oprea. 2009. A Manipulator Can Aid Prediction Market Accuracy. Economica 76, 302 (2009), 304–314. https://doi.org/10.1111/j.1468-0335.2008.00734.x
- Tilmann Gneiting and Adrian E. Raftery. 2007. Strictly Proper Scoring Rules, Prediction, and Estimation. Journal of the American Statistical Association 102, 477 (2007), 359–378. https://doi.org/10.1198/016214506000001437
- Glenn W. Brier. 1950. Verification of Forecasts Expressed in Terms of Probability. Monthly Weather Review 78, 1 (1950), 1–3. https://doi.org/10.1175/1520-0493(1950)078<0001:VOFEIT>2.0.CO;2
- Robin Hanson. 2003. Combinatorial Information Market Design. Information Systems Frontiers 5, 1 (2003), 107–119. https://doi.org/10.1023/A:1022058209073
- Yiling Chen and David M. Pennock. 2007. A Utility Framework for Bounded-Loss Market Makers. In Proceedings of the 23rd Conference on Uncertainty in Artificial Intelligence (UAI '07). AUAI Press, Arlington, VA, USA, 49–56. https://arxiv.org/abs/1206.5252
- Jacob Abernethy, Yiling Chen, and Jennifer Wortman Vaughan. 2013. Efficient Market Making via Convex Optimization, and a Connection to Online Learning. ACM Transactions on Economics and Computation 1, 2, Article 12 (May 2013), 39 pages. https://doi.org/10.1145/2465769.2465777
- Yiling Chen and David M. Pennock. 2010. Designing Markets for Prediction. AI Magazine 31, 4 (2010), 42–52. https://doi.org/10.1609/aimag.v31i4.2313
- David M. Pennock. 2004. A Dynamic Pari-Mutuel Market for Hedging, Wagering, and Information Aggregation. In Proceedings of the 5th ACM Conference on Electronic Commerce (EC '04). ACM, New York, NY, USA, 170–179. https://doi.org/10.1145/988772.988799
- Hayden Adams, Noah Zinsmeister, and Dan Robinson. 2020. Uniswap v2 Core. Technical Report (whitepaper), March 2020. https://app.uniswap.org/whitepaper.pdf
- Guillermo Angeris and Tarun Chitra. 2020. Improved Price Oracles: Constant Function Market Makers. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies (AFT '20). ACM, New York, NY, USA, 80–91. https://doi.org/10.1145/3419614.3423251
- Gnosis. 2020. Conditional Tokens Documentation, Release 1.0.3 (Developer Guide). Contracts: https://github.com/gnosis/conditional-tokens-contracts. https://gnosis-conditional-tokens.readthedocs.io/en/latest/developer-guide.html. Accessed September 2026.
- Ciamac Moallemi and Dan Robinson. 2024. pm-AMM: A Uniform AMM for Prediction Markets. Paradigm Research (November 5, 2024). https://www.paradigm.xyz/2024/11/pm-amm
- Christian Slamka, Bernd Skiera, and Martin Spann. 2013. Prediction Market Performance and Market Liquidity: A Comparison of Automated Market Makers. IEEE Transactions on Engineering Management 60, 1 (2013), 169–185. https://doi.org/10.1109/TEM.2012.2191618
- Polymarket. 2026. Polymarket Documentation: Order Lifecycle, Wallets and Authentication, and Contracts. https://docs.polymarket.com/concepts/order-lifecycle. Accessed September 2026.
- Jupiter. 2026. Swap API (Swap V2) Developer Documentation: Build Endpoint for Raw Swap Instructions. https://developers.jup.ag/docs/swap/build. Accessed September 2026.
- Mayan Finance. 2026. Mayan Documentation: Swift and MCTP Architecture. https://docs.mayan.finance/architecture/swift. Accessed September 2026.
- Solana Foundation. 2026. Tokens on Solana: Token Program and Token Extensions (Token-2022). https://solana.com/docs/tokens. Accessed September 2026.
- Solana Foundation. 2026. Solana Documentation: Transactions, Versioned Transactions, Compute Budget, and Cross Program Invocation. https://solana.com/docs/core/transactions. Accessed September 2026.
- Anchor. 2026. Anchor Documentation: A Development Framework for Building Secure Solana Programs. https://www.anchor-lang.com/docs. Accessed September 2026.
- Jean-Michel Muller. 2016. Elementary Functions: Algorithms and Implementation (3rd ed.). Birkhäuser, Boston, MA. https://doi.org/10.1007/978-1-4899-7983-4
- Philip Daian, Steven Goldfeder, Tyler Kell, Yunqi Li, Xueyuan Zhao, Iddo Bentov, Lorenz Breidenbach, and Ari Juels. 2020. Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability. In 2020 IEEE Symposium on Security and Privacy (SP). IEEE, 910–927. https://doi.org/10.1109/SP40000.2020.00040
- Liyi Zhou, Kaihua Qin, Christof Ferreira Torres, Duc V. Le, and Arthur Gervais. 2021. High-Frequency Trading on Decentralized On-Chain Exchanges. In 2021 IEEE Symposium on Security and Privacy (SP). IEEE, 428–445. https://doi.org/10.1109/SP40001.2021.00027
- Polymarket. 2026. Builder Program: Overview, Fees, and Tiers. Polymarket Documentation. https://docs.polymarket.com/programs/builders/overview. Accessed September 2026.
- Privy. 2026. Wallet Infrastructure: Security Architecture. Privy Documentation. https://docs.privy.io/security/wallet-infrastructure/architecture. Accessed September 2026.
- UMA. 2026. How Does UMA's Oracle Work? UMA Documentation (Optimistic Oracle). https://docs.uma.xyz/protocol-overview/how-does-umas-oracle-work. Accessed September 2026.
Appendix ANotation
Symbols are grouped by the part of the paper in which they are introduced. Symbols used only inside a single proof are defined where they appear.
| Symbol | Meaning |
|---|---|
| , | Number of mutually exclusive and exhaustive outcomes; the index set |
| Realized (winning) outcome | |
| , | Collateral token of a market (an SPL mint); token a trader pays with |
| , | Decimals of the collateral mint; grid unit |
| , | Rounding up or down to the collateral grid |
| , , | Fee rate of a market and its creator and protocol shares, |
| Protocol bounds on the fee rate | |
| Trading close time | |
| , | All-ones vector; -th unit vector |
| Symbol | Meaning |
|---|---|
| Stake of trader in the pool of outcome | |
| , | Total stake in pool ; total stake |
| , | Implied probability ; decimal odds before fees |
| , | Claim of trader under the losing-side fee rule (Eq. (4.1)); under the gross-pool rule |
| , , | Total fee and its creator and protocol parts (Eq. (4.2)) |
| , | Payout per unit stake on outcome if it wins, before and after an additional stake |
| Number of winning claims (Remark 4.4) |
| Symbol | Meaning |
|---|---|
| , | Outstanding shares per outcome, seed shares included; seed state |
| , | Liquidity-sensitivity parameter, default ; its bounds |
| , | Liquidity parameter ; its value at the seed state |
| LS-LMSR cost function (Eq. (5.2)) | |
| , | Scaled quantity ; LMSR weight |
| Shannon entropy of the weight vector | |
| , | Marginal price ; displayed probability |
| Shrinkage of the display toward uniform (Eq. (5.5)) | |
| , | Overround ; its lower bound (Eq. (5.8)) |
| , , | Price floor, price ceiling and display ceiling (Proposition 5.10) |
| , | Trade vector; trade cost |
| Seed collateral | |
| , | Worst-case seed loss ; market maker's loss at state if wins |
| Outcome capacity | |
| Vault balance of a market | |
| Share quantity bought by a budget order (Proposition 5.13) | |
| Depth: collateral needed to move the leading displayed probability by one percentage point |
| Symbol | Meaning |
|---|---|
| Fixed-point scale | |
| One collateral grid unit in WAD units, | |
| , , | Fixed-point approximation of a function; of the cost function; of the trade cost |
| , | Largest outstanding quantity; total outstanding quantity |
| , | Exponent relative to the leader ; sum of relative weights |
| Fixed-point logarithm | |
| Exponent cutoff, 42 | |
| , | Trader-set bound on the cost of a buy; on the refund of a sell |
| , , | Swap input; quoted output; delivered output |
| , | Slippage tolerance; enforced minimum output |
| , | Traded volume of a market before fees; a seeding creator's net result (Proposition 13.1) |
| Symbol | Meaning |
|---|---|
| , | Number of simulated markets; trades per market |
| Latent true probability of an outcome | |
| Brier score | |
| Largest attainable seed loss as a fraction of | |
| Simulated vault with a pool-favoring rounding margin |
Appendix BProofs
Throughout, , , , , , , and . Note that and that , because .
B.1Proof of Proposition 5.2
From and ,
For Eq. (5.4), write and , so that . Summing Eq. (B.1) over gives ; dividing by this sum and setting yields Eq. (5.5).
B.2Proof of Proposition 5.3(iii) and the Hessian
Let , which is convex, and let for (the perspective of ). For points , and , put and . Convexity of gives
so is jointly convex. Since is composed with a linear map, is convex on the domain. Strict positivity of is immediate from Eq. (5.3), and because the Hessian of a convex function is positive semidefinite.
Differentiating Eq. (B.1) with and gives the Hessian
Using , one checks that lies in its null space, as homogeneity requires. At a balanced state, and , so , which completes the proof of Proposition 5.4.
B.3Proof of Proposition 5.5
The map sends the domain onto the scaled simplex , so it suffices to bound on . The lower bound rests on the following lemma.
Let be an index of a largest coordinate of and let with . Moving mass from coordinate to coordinate strictly decreases .
Since and , the derivative of in direction is . Along the segment , , coordinate is the strict maximum, so and . If the bracket is positive; if then . Hence the derivative is negative on .
Eq. (5.7) was obtained in B.1. The upper bound is , with equality exactly when is uniform, that is when all are equal, that is when . For the lower bound, applying Lemma B.1 to every moves to the vertex and strictly decreases unless is already a vertex. At the vertex, , for , and
Multiplying by gives in Eq. (5.8).
B.4Proofs of Propositions 5.10 and 5.11
Price floor. Write . Since , , a convex function whose maximum over is attained at a vertex, with value . Hence . By B.3, . Adding the two bounds gives , and both are attained at , . The approximation follows from .
Price ceiling. By Proposition 5.3(iii), is nondecreasing. As , , and is a continuous function of on . Therefore .
Display ceiling. Eq. (5.5) gives with . If then . Otherwise both factors are nonnegative, (Proposition 5.7) and , so .
Proposition 5.11. Put and , so that and . The hypothesis is . Then
since and for . On the path the hypothesis reads , which rearranges to the stated threshold.
B.5Proofs of Propositions 5.12 and 5.13
Proposition 5.12. (i) The sum telescopes. (ii) Let be the traders' payment for trade (negative for a refund). A buy pays ; a sell receives . In both cases , so each trade raises by and by . For a cycle with , the traders' total payment is , and nonnegative fees only increase it.
Proposition 5.13. Let . It is continuous with and by Proposition 5.3(iii), so is strictly increasing and unbounded, and has a unique root . Convexity gives , hence ; Proposition 5.10 gives , hence . When lies on the grid, if and only if , so the largest admissible grid quantity is . Bisection over the grid points of the bracket finds it in cost evaluations.
B.6Numerical Verification
Running python3 sim/theory_figs.py --verify repeats every
check below with mpmath. Eqs. (5.3) and (5.4)
were compared with central finite differences of
Eq. (5.2) at 300 random states (
from 2 to 8, all five values of
in Figure 5.1, quantities spanning six decades)
at 50 digits; the largest discrepancy was
. Homogeneity and the Euler identity held to relative error below
. The bounds of Eqs. (5.8), (5.9) and (5.12)
were checked at 4,000 random states at 80 digits, including states
within
of a vertex, with no violation. The Hessian (B.2) agreed with finite
differences of Eq. (5.3) to
at 100 states, and at 3,000 states its smallest eigenvalue was zero up
to a relative rounding error of
. The bracket of Eq. (5.14) held for 2,000
random budget orders. The crossing points of
Proposition 5.11 for
, located by bisection, are
for
and
for
, with capacity
and
at those points.
Appendix CFixed-Point Algorithms
These are the algorithms of our reference emulation (Section 6.7); they describe a design class, not a listing of the Engine II
program. All quantities are integers; a real
is held as
in 128 bits. round rounds a quotient to nearest with ties
away from zero. A line marked 256-bit divides a product
that can exceed
in a 256-bit intermediate (mul-div); the quotient fits in 128 bits (Section 6.5). All loops have fixed trip counts.
Input: signed WAD integer x
Output: unsigned WAD integer y = e^x * WAD, rounded
Const: LN2_36 = round(ln 2 * 10^36); N = 16
X_MAX = floor(ln((2^128 - 1) / WAD) * WAD) - 1293 (about 47.28)
X_MIN = ceil(ln(1 / (2 * WAD)) * WAD) (about -42.14)
1: if x > X_MAX then revert // result would overflow u128
2: if x < X_MIN then return 0 // e^x * WAD < 1/2
3: x36 <- x * WAD // i128, |x36| < 4.8 * 10^37
4: k <- round(x36 / LN2_36) // x = k ln 2 + r
5: r <- round((x36 - k * LN2_36) / WAD) // |r| <= (ln 2)/2 in WAD
6: p <- WAD
7: for j = N down to 1 do // Horner form of sum r^j/j!
8: p <- WAD + round(r * p / (j * WAD)) // |r * p| < 5 * 10^35
9: end for
10: if k >= 0 then return p * 2^k // exact shift
11: return round(p / 2^(-k))
Input: unsigned WAD integer y, 1 <= y <= 2^128 - 1
Output: signed WAD integer l = ln(y / WAD) * WAD, rounded
Const: LN2_36; J = 12 (odd powers s^1 to s^23)
1: k <- bitlength(y) - bitlength(WAD) // bitlength(WAD) = 60
2: (num, den) <- (y, WAD * 2^k) if k >= 0 else (y * 2^(-k), WAD)
3: if num * WAD < round(WAD / sqrt 2) * den then
4: k <- k - 1 and recompute (num, den) // now m = num/den in
5: end if // [1/sqrt 2, sqrt 2)
6: s <- round((num - den) * WAD / (num + den)) // 256-bit; |s| < 0.172
7: s2 <- round(s * s / WAD)
8: p <- round(WAD / (2J - 1))
9: for j = J - 2 down to 0 do // Horner form in s^2
10: p <- round(WAD / (2j + 1)) + round(s2 * p / WAD)
11: end for
12: return round((k * LN2_36 + 2 * s * p) / WAD) // k ln 2 + 2 atanh(s)
Input: shares q_1..q_n in WAD (on the collateral grid), n <= 8;
alpha in WAD, 0.01 * WAD <= alpha <= 0.20 * WAD
Output: C~(q) in WAD, with C~(q) >= max_i q_i
Const: Z_MAX = 42 * WAD
1: Q <- q_1 + ... + q_n ; qmax <- max_i q_i
2: sumw <- 0
3: for i = 1 to n do
4: u <- floor((qmax - q_i) * WAD^2 / (alpha * Q)) // 256-bit
5: u <- min(u, Z_MAX) // u <= min(1/alpha, z_max)
6: sumw <- sumw + floor(WAD^2 / exp_wad(u)) // weight in [0, WAD]
7: end for // WAD <= sumw <= n * WAD
8: L <- ln_wad(sumw) // 0 <= L <= ln(n) * WAD + 2
9: return qmax + round(alpha * Q * L / WAD^2) // 256-bit; q_max + b L
Input: state (q, V, C~(q)); outcome i; quantity dq > 0, a multiple of
g = 10^(18 - d); payment bound kappa_max; fee rate phi (WAD)
Output: payment P into the vault and fee F; updated state
1: require (q_i + dq) / g <= 2^64 - 1 // SPL amounts are u64
2: q' <- q + dq * e_i
3: C' <- cost(q') // Algorithm C.3, full state
4: kappa <- C' - C~(q) // signed, before rounding
5: P <- max(ceil(kappa / g) * g, g) // round up, at least 1 unit
6: F <- ceil(phi * P / (WAD * g)) * g // fee, rounded up
7: require P + F <= kappa_max // trader's bound
8: V <- V + P // F goes to fee accounts
9: (q, C~(q)) <- (q', C')
Input: state (q, V, C~(q)); outcome i; quantity dq > 0, a multiple of
g, held by the trader; refund bound r_min; fee rate phi (WAD)
Output: refund R out of the vault and fee F; updated state
1: q' <- q - dq * e_i
2: C' <- cost(q') // Algorithm C.3, full state
3: kappa <- C~(q) - C' // refund before rounding
4: require kappa >= 0 // else revert
5: R <- floor(kappa / g) * g // round down
6: F <- ceil(phi * R / (WAD * g)) * g // fee, rounded up, F <= R
7: require R - F >= r_min // trader's bound
8: V <- V - R // R - F to trader, F to fees
9: (q, C~(q)) <- (q', C')
Three remarks connect the pseudocode to the analysis. First, Algorithms C.4 and C.5 compute from two complete evaluations of Algorithm C.3; the stored caches the output on the current state and is never updated incrementally, which makes the telescoping in Propositions 6.2 and 6.3 exact. Second, is never rounded on its own: it enters lines 4 and 9 of Algorithm C.3 inside single rounded quotients, which avoids a relative error of order (in WAD units) in small markets, and rounding down makes exact (Invariant 11.4). Third, the fee lines and the trader bounds (Section 7.3) and (Algorithm C.5) are design requirements; fees leave through separate accounts, so the vault accounting is unchanged by them.
Appendix DProtocol Constants
Table D.1 collects the constants of Engine II and of the fixed-point layer. The status column separates three kinds of entries: values of the Engine II program as specified by the author (program), parameters of our reference emulation of Section 6 and Appendix C (reference), and requirements that the design imposes and that this paper does not verify against the program code (requirement). Fee bounds are given symbolically; the paper states no fee percentages.
| Constant | Symbol | Value | Status |
|---|---|---|---|
| Fixed-point scale | program | ||
| Storage width | unsigned 128-bit (u128) |
program | |
| Wide intermediate | 256-bit mul-div for products of two WAD values | reference | |
| Liquidity sensitivity, default | program | ||
| Liquidity sensitivity, bounds | program | ||
| Maximum outcomes (Solana) | , set by the compute budget | program | |
| Maximum outcomes (EVM sibling) | sibling implementation | ||
| Exponent cutoff | ; binds only for | program | |
| Reciprocal underflow point | derived | ||
exp overflow point in u128 |
derived | ||
exp evaluation |
range reduction by at scale , Horner degree 16 | reference | |
ln evaluation |
reduction to , 12 odd terms of | reference | |
| Collateral grid | , shares and balances on the grid | program | |
| Admissible decimals | requirement | ||
| Amount width |
SPL amounts are u64
[30]
|
external | |
| Buy rounding | , at least one grid unit | program (rounding up); minimum is reference | |
| Sell rounding | ; negative computed refund reverts | program (rounding down); revert is reference | |
| Settlement | 1 collateral unit per winning share | program | |
| Seed collateral | program identity; grid rounding up is reference | ||
| Worst-case seed loss | program identity | ||
| Price floor | of order (Proposition 5.10) | derived | |
| Fee rate | per market, | program (configurable) | |
| Fee split | Section 13 | ||
| Oracle in trade path | none | program | |
| Program ID |
4tjbrvyzZ4PVuCnLKhrbbpcKd4ghnT6xxWPLQ2Mav68z
|
program |
Three notes qualify the table. First, the maximum of 8 outcomes on
Solana is a consequence of the per-transaction compute budget
[31], because
the work of a trade grows linearly in
(Section 6.6); we report no compute-unit
measurements of the program. Second, the two derived points explain
the cutoff: at
the reciprocal
that forms a weight reaches zero, and near
the WAD value of
would no longer fit in 128 bits, so
lies between them. Third, the entries marked
reference describe the emulation behind
Table 6.1. The Engine II program uses its own
hand-written exp and ln in the same unsigned
128-bit WAD format, and their development verification is reported
separately in Section 6.7.
Appendix ESimulation Configuration and Reproducibility
This appendix lists the parameters of the experiments in Section 12; E1 to E4 denote the experiments of Sections 12.2 to 12.5, and the entry-time analysis is part of E4. The accompanying simulation code consists of a module with the market-maker mathematics, a self-test, one script per experiment, a figure script and a driver that runs all stages in order. The driver regenerates every result file, a summary file with each number quoted in Section 12, and Figures 12.1 to 12.5.
| Item | Setting |
|---|---|
| Software | Python 3.11.15, NumPy 2.4.4, mpmath 1.4.1 (self-test), Matplotlib 3.10.9 (figures) |
| Arithmetic | IEEE 754 double precision; evaluated relative to the leading outcome; prices by Eq. (5.3) |
| Random numbers | NumPy PCG64; seeds 20261001 (self-test), 20261002 (E2), 20261003 (E3), 20261004 (E4), 20261009 and 20261024 (E4 sensitivity runs); E1 is deterministic |
| Buy solver | For an order of collateral units, Newton iteration in on the bracket with bisection fallback; relative tolerance |
| Sell solver | Newton iteration from with bisection fallback, capped by the trader inventory |
| E1 | , USD, ; 281 order sizes, log-spaced from 10 to USD; LMSR with ; CPMM reserves and USD |
| E2 | , USD, , LMSR ; order size LN(1,000 USD, 1.0), side uniform; mixed flow: sell probability 0.30; stop at USD notional; at 121 log-spaced checkpoints from to USD; 8 paths per case |
| E3 markets | (25,000 for each ), ; ; log-uniform on USD; , |
| E3 flow | adversarial regime with probability 0.2; trader mix (noise, informed, adversarial) (0.70, 0.25, 0.05) in the base regime and (0.35, 0.15, 0.50) in the adversarial regime; noise sell probability 0.35; size LN(50 USD, 1.2) with probability 0.95, else Pareto with scale 5,000 USD and shape 1.6, capped at USD; adversarial size LN(0.05, 1.0), capped at |
| E3 checks | relative tolerance , and strict; margin per trade |
| E4 | , 1,000 traders per market, , USD; LS-LMSR ; LMSR ; CPMM reserves (sensitivity: 648.22) USD; parimutuel initial pools 5,000 USD each, ; ; belief noise 1.0 in log-odds (sensitivity: 0.5, 2.0); budget LN(100 USD, 1.0) |
Self-test. The code compares Eq. (5.3) with an 80-digit evaluation of Eq. (5.4) at 200 states (largest relative error ) and with finite differences, checks the overround bounds of Proposition 5.5 at 400,000 random states, and verifies that a buy followed by the matching sell restores shares and collateral to within and relative.
Determinism. Every stage draws from seeded generators, and each E2 path has its own seed, so results do not depend on the scheduling of the two worker processes. Repeated runs with the software above reproduced every quoted number.
Runtime. On a virtual machine with two cores of an Intel Xeon processor at 2.80 GHz and 7.8 GB of memory, shared with other jobs, the full study took 596 s of wall-clock time: self-test 0.8 s, E1 0.2 s, E2 32 s, E3 252 s (about 396,000 simulated trades per second), E4 with the entry-time analysis 308 s, figures 3 s. Because the machine was shared, timings varied between runs (E2 took 64 s in an earlier run); the results did not.
Appendix FDisclaimer
This paper is provided for informational and research purposes only. It describes the design of a software protocol and analyzes it mathematically and by simulation. It is not an offer or solicitation to buy or sell any asset, security or contract, and it is not investment, legal, tax or financial advice.
All quantitative results on market behavior in this paper are simulation results or results of exact and fixed-point computation under stated assumptions. They are not measurements of live markets, and they do not predict the outcome of any market, the return of any position or the result of any seed provider.
Trading in prediction markets can result in the loss of the entire amount committed. The availability of prediction markets, and of individual market types, depends on the laws of each jurisdiction, and users are responsible for complying with the rules that apply to them. Descriptions of third-party systems, including Solana, Jupiter, Mayan, Privy, Polygon and Polymarket, reflect their public documentation as of September 2026 and may change without notice. Statements about planned or possible extensions express research directions, not commitments.