5D Library › Prediction Market Microstructure, Bregman Information Projection and Cross-Book Arbitrage Bounds · 中文

Chapter 4. Books of Exclusive Outcomes: Executable Arbitrage When Prices Do Not Sum to 1

What looks like a Dutch book

Exactly one of five candidates will win. Each of five contracts pays 1 if its candidate wins, so buying one of each (a “set”) pays exactly 1. If the five best asks sum to 0.96, each set locks in 0.04 — a textbook Dutch book. Conversely, if the best bids sum to more than 1, selling a set locks in a profit. This is the simplest no-arbitrage constraint in a market of exclusive outcomes: prices must sum to 1.

In real books the asks usually sum to more than 1: every outcome has a bid-ask spread, and longshots are often overpriced (Chapter 1); the excess is often called the overround. Occasionally the sum dips below 1. This chapter asks how much profit such a moment actually offers.

Walking the book, fees and lock-up

The eighth program builds a five-candidate book whose best asks sum to 0.96, with two more expensive layers behind each. It buys layer by layer and charges three kinds of cost: a fixed 2 per order (network, withdrawal or minimum-ticket costs); a proportional fee of ϕP(1−P)\phi P(1-P) per contract (some exchanges use a fee of this P(1−P)P(1-P) shape), with ϕ=0.02\phi = 0.02 and 0.070.07; and the lock-up until resolution in six months, compared with Chapter 3’s 14.5 % hurdle.

Calculation

# Chapter 4. p08: A five-outcome book whose best asks sum to 0.96.
# Exactly one outcome will win; buying one YES of each ("a set") pays 1
# for sure. The quoted edge is 1 - 0.96 = 0.04 per set. The program walks
# each order book level by level, then charges:
#   fixed   2 per leg order (network, withdrawal or minimum-ticket costs)
#   fee     phi * P * (1 - P) per contract at price P - a schedule of the
#           form some event exchanges use; phi = 0.02 and phi = 0.07
#   lock-up the payout arrives in 6 months; return is annualised and
#           compared with rho = 0.145 from Chapter 3
BOOK = {"A": [(0.31, 3000), (0.32, 4000), (0.34, 9000)],
        "B": [(0.24, 2500), (0.25, 3500), (0.27, 9000)],
        "C": [(0.18, 2000), (0.19, 5000), (0.21, 9000)],
        "D": [(0.12, 4000), (0.13, 3000), (0.15, 9000)],
        "E": [(0.11, 1500), (0.12, 4000), (0.14, 9000)]}
FIXED, TAU = 2.0, 0.5

def walk(levels, k):
    cost = fee_base = 0.0
    left = k
    for price, size in levels:
        take = min(left, size)
        cost += take * price
        fee_base += take * price * (1 - price)
        left -= take
        if left == 0:
            break
    return cost, fee_base

def result(k, phi):
    cost = fb = 0.0
    for levels in BOOK.values():
        c, f = walk(levels, k)
        cost += c
        fb += f
    capital = cost + phi * fb + FIXED * len(BOOK)
    return cost, k - capital, capital

if __name__ == "__main__":
    top = sum(levels[0][0] for levels in BOOK.values())
    print("sum of best asks {:.2f}; quoted edge {:.2f} per set".format(
        top, 1 - top))
    for phi in (0.0, 0.02, 0.07):
        print("\nphi = {:.2f}".format(phi))
        print("    sets   cost of sets   net profit   capital   "
              "annualised")
        best = max(range(1, 12001), key=lambda k: result(k, phi)[1])
        sizes = (200, 1000, 1500, 3000, 6000)
        if result(best, phi)[1] > 0:
            sizes += (best,)
        for k in sizes:
            cost, net, cap = result(k, phi)
            ann = ((k / cap) ** (1 / TAU) - 1) if net > 0 else float("nan")
            print("   {:5d}   {:12.2f}   {:10.2f}   {:7.2f}   {:>10}"
                  .format(k, cost, net, cap,
                          "{:+.1%}".format(ann) if net > 0 else "loss"))
        if result(best, phi)[1] > 0:
            print("   largest profit at {} sets".format(best))
        else:
            print("   no size is profitable")
    print("\nReading: the quoted 4 % is a ceiling. The sum is 0.96 for only")
    print("1,500 sets; fixed costs eat small sizes and depth eats large")
    print("ones; a fee of 0.07 P(1-P) per contract eats it all. The best")
    print("case, about 7 % a year, beats a 4.5 % risk-free rate but not the")
    print("14.5 % hurdle of Chapter 3 - for a riskless trade, if the")
    print("contracts really are exhaustive and settle as written.")
# sum of best asks 0.96; quoted edge 0.04 per set
#
# phi = 0.00
#     sets   cost of sets   net profit   capital   annualised
#      200         192.00        -2.00    202.00         loss
#     1000         960.00        30.00    970.00        +6.3%
#     1500        1440.00        50.00   1450.00        +7.0%
#     3000        2910.00        80.00   2920.00        +5.6%
#     6000        5940.00        50.00   5950.00        +1.7%
#     3010        2920.00        80.00   2930.00        +5.5%
#    largest profit at 3010 sets
#
# phi = 0.02
#     sets   cost of sets   net profit   capital   annualised
#      200         192.00        -4.99    204.99         loss
#     1000         960.00        15.05    984.95        +3.1%
#     1500        1440.00        27.58   1472.42        +3.8%
#     3000        2910.00        34.75   2965.25        +2.4%
#     6000        5940.00       -41.91   6041.91         loss
#     2500        2415.00        37.41   2462.59        +3.1%
#    largest profit at 2500 sets
#
# phi = 0.07
#     sets   cost of sets   net profit   capital   annualised
#      200         192.00       -12.46    212.46         loss
#     1000         960.00       -22.32   1022.32         loss
#     1500        1440.00       -28.48   1528.48         loss
#     3000        2910.00       -78.38   3078.38         loss
#     6000        5940.00      -271.69   6271.69         loss
#    no size is profitable
#
# Reading: the quoted 4 % is a ceiling. The sum is 0.96 for only
# 1,500 sets; fixed costs eat small sizes and depth eats large
# ones; a fee of 0.07 P(1-P) per contract eats it all. The best
# case, about 7 % a year, beats a 4.5 % risk-free rate but not the
# 14.5 % hurdle of Chapter 3 - for a riskless trade, if the
# contracts really are exhaustive and settle as written.

Without proportional fees, 200 sets do not even cover the fixed costs and lose −2.00; 1,500 sets is the most the book offers at a sum of 0.96, netting 50.00 on 1,450.00 of capital, +7.0 % a year; buying on, total profit peaks at 3,010 sets (80.00), but the dearer layers drag the annual return down to +5.5 %. At ϕ=0.02\phi = 0.02 the best case is +3.8 % a year, below a 4.5 % risk-free rate. At ϕ=0.07\phi = 0.07 every size loses: the fees on five legs exceed the quoted edge of 0.04.

Net profit of the five-outcome book against the number of sets bought, for three proportional fees; fixed costs eat small sizes and depth eats large ones.

So “0.04” is a ceiling, not a return. Fixed costs eat small sizes, the depth of the book eats large ones, and a proportional fee can eat all of it; what is left must still beat what the capital could earn elsewhere in six months. Even in the best case, this riskless trade is riskless only if the contracts really are exclusive and exhaustive and settle exactly as written — one vague settlement clause (does “any other candidate” include one who withdrew?) is enough to make a set no longer pay 1 for sure.

Stale quotes and leg risk

All of the above assumes every resting order is filled. Real books move, a displayed quote may be stale, and the legs can only be bought one at a time. The ninth program simulates this: fresh asks always sum to more than 1, so a sum below 1 appears only because some quotes are stale.

Calculation

# Chapter 4. p09: Apparent versus executable: stale quotes and leg risk.
# An n-outcome market; true probabilities are a random point on the
# simplex. Fresh asks are p_i + 0.005, so fresh asks sum to above 1 and
# offer no arbitrage. Each displayed quote is stale with probability 0.2:
# it shows an old price that differs from p_i by noise of sd 0.15 on the
# log-odds scale. 20,000 snapshots per market size.
# A trader who sees sum(asks) < 1 buys all legs in turn; each stale leg
# is gone with probability 0.6 by the time it is reached (someone faster
# took it) and must be bought at the fresh ask instead.
import math
import random

H, STALE, SD, GONE, S = 0.005, 0.2, 0.15, 0.6, 20000

def sig(x):
    return 1 / (1 + math.exp(-x))

def logit(p):
    return math.log(p / (1 - p))

def one(rng, n):
    g = [rng.gammavariate(1.0, 1.0) for _ in range(n)]
    p = [x / sum(g) for x in g]
    p = [min(max(x, 0.002), 0.998) for x in p]
    fresh = [x + H for x in p]
    shown, stale = [], []
    for x, f in zip(p, fresh):
        if rng.random() < STALE:
            shown.append(sig(logit(x) + rng.gauss(0, SD)) + H)
            stale.append(True)
        else:
            shown.append(f)
            stale.append(False)
    apparent = 1 - sum(shown)
    if apparent <= 0:
        return apparent, None
    paid = 0.0
    for a, f, st in zip(shown, fresh, stale):
        paid += f if (st and a < f and rng.random() < GONE) else a
    return apparent, 1 - paid

if __name__ == "__main__":
    rng = random.Random(59009)
    print("   legs  P(sum asks < 1)  count  apparent  realised"
          "  P(realised > 0)")
    for n in (2, 5, 10, 20):
        app, real = [], []
        for _ in range(S):
            a, r = one(rng, n)
            if r is not None:
                app.append(a)
                real.append(r)
        k = len(app)
        print("   {:4d}       {:7.4f}     {:5d}   {:+.4f}   {:+.4f}"
              "          {:6.3f}".format(n, k / S, k, sum(app) / k,
                                         sum(real) / k,
                                         sum(r > 0 for r in real) / k))
    print("\nReading: a book of stale quotes shows an apparent arbitrage in")
    print("about one snapshot in ten with two to five legs (more legs mean")
    print("more spread to overcome, so fewer appear). But the bargains are")
    print("the quotes most likely to vanish: executed leg by leg, the")
    print("apparent edge shrinks to almost nothing at two legs and turns")
    print("into a loss from five legs on.")
#    legs  P(sum asks < 1)  count  apparent  realised  P(realised > 0)
#       2        0.1099      2198   +0.0206   +0.0019           0.404
#       5        0.0950      1901   +0.0189   -0.0085           0.376
#      10        0.0164       328   +0.0147   -0.0256           0.265
#      20        0.0001         1   +0.0270   -0.0243           0.000
#
# Reading: a book of stale quotes shows an apparent arbitrage in
# about one snapshot in ten with two to five legs (more legs mean
# more spread to overcome, so fewer appear). But the bargains are
# the quotes most likely to vanish: executed leg by leg, the
# apparent edge shrinks to almost nothing at two legs and turns
# into a loss from five legs on.

With two to five outcomes, about one snapshot in ten shows an arbitrage (0.1099 and 0.0950), with an average displayed edge of about 0.02. More legs mean more spread to overcome, so fewer opportunities appear: only 0.0164 with ten outcomes.

Execution changes the picture. The cheap quotes are exactly the ones most likely to have been taken by someone else; when their turn comes, the trader must buy at the fresh ask. With two legs a displayed edge of +0.0206 shrinks to +0.0019 after execution, with a probability of profit of only 0.404; with five legs the average is a loss of −0.0085; with ten, −0.0256. This is adverse selection: the arbitrage you can see is mostly the arbitrage you cannot catch.

Note

The price of filling at once. Leg risk is reduced by sending all orders at once, or by a basket order where the platform offers one. But simultaneous orders need enough depth on every leg, and the first section of this chapter showed that depth is limited. Executable arbitrage is the intersection of fast, deep and cheap, not the gap between a sum of quotes and 1.

Hypothesis · not established

The author’s hypothesis (not yet tested): in many-outcome markets, most recorded moments at which the asks sum to less than 1 last less than the fastest public API polling interval; historical arbitrage profits computed from displayed prices are negative on average once each leg is filled at the fresh quote. What would show it wrong: such moments commonly last several polling intervals, or leg-by-leg execution at fresh quotes still earns a clearly positive average.

Summary

The prices of exclusive outcomes must sum to 1; below 1, buying a set locks in a profit, above 1, selling one does. But the gap between the sum of quotes and 1 is only a ceiling: fixed costs, the depth of the book and proportional fees erode it in turn — in the example the best case is about 7 % a year, a fee of 0.07P(1−P)0.07\,P(1-P) makes every size a loss, and what remains must still beat six months’ opportunity cost of capital. Stale quotes create many displayed arbitrages, but the cheap quotes vanish first, and executed leg by leg they lose money on average.

Fan, Y. (2026). Prediction Market Microstructure, Bregman Information Projection and Cross-Book Arbitrage Bounds: Logarithmic Market Scoring Rules, Favorite-Longshot Calibration Bias, Lock-Up Opportunity Cost and Frank-Wolfe Combinatorial Pricing [预测市场微观结构、布雷格曼信息投影与跨盘口无套利边界] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090166 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).