Quantile prediction markets on Bitcoin
How Glimpse prices, trades and settles its markets: the main results, interactive examples, and the link to online learning and AI forecasting.
Executive summary
Glimpse is a prediction market for prices. Most prediction markets ask yes/no questions and match buyers with sellers through an order book, which works poorly when a question has many possible answers: every answer needs its own buyers and sellers, and most of those order books sit empty. Glimpse is designed for questions about where a price will close.
Glimpse splits the price axis into ranges and offers a contract on each range that pays ₿100 if the price closes inside it (₿1 is one satoshi, a hundred-millionth of a bitcoin). There is no order book. A single formula, the cost function \(C\), keeps track of how many contracts have been bought on each range. The price of a range is how fast \(C\) rises when that range is bought, and a trade costs the value of \(C\) after the trade minus its value before. Because a contract pays ₿100, its price divided by 100 is the market's probability for that range, and the prices across all ranges form the market's forecast of the closing price. This market maker is the Quantile Liquidity-Sensitive Logarithmic Market Scoring Rule, or QLS-LMSR.
The design has four properties, each backed by results in the research it builds on. Glimpse funds each market up front, and that amount is the most it can lose. Prices move less as more money comes in, so a busy market is harder to push around than a quiet one. A large order costs the same whether it is placed at once or in pieces, so there is nothing to gain by breaking it up. And when traders' information comes from independent sources (formally, independent given the outcome), the best strategy is to trade toward what one actually believes, because bluffing does not pay. The Kelly criterion then gives a rule for how much to trade.
Glimpse can also be read as a machine-learning algorithm. Its forecast is computed the same way as the weights in the multiplicative-weights algorithm for combining expert predictions, which is known to do nearly as well over time as the best single expert. When traders size their bets by the Kelly criterion, the market price is an average of their beliefs weighted by their bankrolls, and settlement updates those bankrolls by Bayes' rule, just as a Bayesian ensemble updates the weights of its models. An AI forecasting model can therefore trade on Glimpse like any other participant, gaining influence when it is right and losing it when it is wrong. Glimpse runs this design on live hourly and daily markets.
1. The market maker
A Glimpse market partitions the price axis into \(n\) ranges; the running example on this page uses 500 ranges of $1,000 each. For every range the market offers an event contract that pays ₿100 if the settlement price lies in that range and nothing otherwise. Instead of matching buyers with sellers, a single automated market maker quotes a price for every range at all times. Its state is the vector \(\mathbf q=(q_1,\dots,q_n)\), where \(q_i\) is the number of contracts on range \(i\) held by all traders, and its prices are derived from the cost function
$$C(\mathbf q)=100\,b(\mathbf q)\,\ln\sum_{j=1}^{n}e^{q_j/b(\mathbf q)},\qquad b(\mathbf q)=\alpha\sum_j q_j,\qquad \alpha=\frac{v}{n\ln n}. \tag{1}$$The price of a contract on range \(i\) is the marginal cost of buying it, \(p_i=\partial C/\partial q_i\), measured in ₿. Differentiating (1) and rearranging gives
$$p_i(\mathbf q)=100\,\big[\,w_i+\alpha H(\mathbf w)\,\big],\qquad w_i=\frac{e^{q_i/b}}{\sum_j e^{q_j/b}},\qquad H(\mathbf w)=-\sum_j w_j\ln w_j . \tag{2}$$The price therefore has two components. The first, \(100\,w_i\), is the market's probability forecast for range \(i\); the vector \(\mathbf w\) is non-negative and sums to one, so a price of ₿12 corresponds roughly to a probability of 12%. The second, \(100\,\alpha H(\mathbf w)\), is a spread that is the same for every range. Because the entropy \(H(\mathbf w)\) is largest when the forecast is uniform and decreases as the forecast concentrates, the spread is widest when the market has received little information and narrows as trading proceeds. Othman et al. show that a spread of this kind is unavoidable: a market maker that is path-independent and whose depth grows with volume cannot keep its prices summing to exactly ₿100 [2].
The quantity \(b\) governs depth. Because it is proportional to the total number of contracts outstanding, a trade of a given size moves prices less in an active market than in a thin one, in keeping with the intuition that a market which has absorbed more information should be harder to move.
The example on this page uses \(n = 500\), \(v = 2\) and an initial 500 contracts per range. Markets in production use the same \(\alpha = 2/(500\ln 500)\) with 40 contracts per range.
2. The life cycle of a market
Each market passes through four stages.
-
Opening
The operator initializes every range with \(q_0\) contracts. The value of this state, \(C(\mathbf q_0)=100\,q_0(v+1)\), is the subsidy. It bounds the operator's loss, and all ranges open at the same price.
-
Trading
Participants buy or sell contracts on any range, or on a set of adjacent ranges, until the market closes. Each trade is priced by the cost function and revises the forecast.
-
Closing
At the scheduled end time trading stops, and positions are held until settlement.
-
Settlement
The settlement price determines the winning range. Each contract on that range pays ₿100 less a 2% fee, and all other contracts expire worthless.
In production, a 500-range market initialized with 40 contracts per range carries a subsidy of \(100\times 40\times 3\) = ₿12,000, and each market settles at the closing price of the hourly candle that ends at its scheduled end time.
3. The cost of a trade
Since prices are marginal costs, the cost of a finite trade is found by integrating the price along the path from the old state to the new one. The prices are the gradient of \(C\), so this integral depends only on the endpoints, and a trade that moves the state from \(\mathbf q\) to \(\mathbf q'\) costs \(C(\mathbf q')-C(\mathbf q)\). With a fee \(\tau = 0.02\), the purchase and the sale of \(\Delta\) contracts are settled as
$$\text{purchase: } (1+\tau)\big[C(\mathbf q+\boldsymbol\Delta)-C(\mathbf q)\big], \qquad\qquad \text{sale: } (1-\tau)\big[C(\mathbf q)-C(\mathbf q-\boldsymbol\Delta)\big]. \tag{3}$$Two consequences follow. Because \(C\) is convex, each additional contract is bought at a slightly higher marginal price, so the average price of a large order is above the price quoted before it (Figure 1). Because the cost depends only on the endpoints, dividing an order into smaller pieces does not change its total cost, and a purchase followed immediately by a sale returns the market to its original state, so the round trip costs only the fees. A position covering several adjacent ranges is priced as a single trade, which allows a trader to take a view on a band of prices, for example from $79,000 to $86,000, in one transaction.
Figure 1. The cost of buying contracts on one range
Opening state of the example market
- Price before
- —
- Price after
- —
- Total paid, with fee
- —
- Average price
- —
A trader whose probability for a range exceeds its price divided by 100 expects to gain by buying it, and one whose probability is lower expects to gain by selling. Chen et al. show that when traders' private signals are independent conditional on the outcome, trading immediately to one's true belief is the unique equilibrium of the logarithmic market scoring rule [3], so neither misreporting nor waiting increases expected profit. Positions can be sized by the Kelly criterion: a trader buys no further than the point at which the price reaches their probability, and scales the position by a fraction to allow for error in their model.
4. Settlement
A trader who holds \(\Delta\) contracts on a range until settlement receives
$$\text{payout}=\begin{cases}(1-\tau)\cdot 100\cdot\Delta & \text{if the settlement price lies in the range,}\\[2pt] 0 & \text{otherwise.}\end{cases} \tag{4}$$Contracts are paid for in full when they are bought, so there is no margin, leverage or liquidation, and the largest possible loss is the amount paid. A position is worth taking when the trader's probability for the range exceeds the break-even probability, the amount paid divided by the payout in (4). In the example market, Alice pays ₿1,126 for 200 contracts on each range from $74,000 to $81,000. If the price settles in that band she receives \(0.98\times 100\times 200\) = ₿19,600, so the trade is worthwhile if she assigns the band a probability of at least 5.7%.
Winning contracts are paid from the funds traders have paid in, supplemented by the subsidy. In a market scoring rule each trader takes over responsibility for the forecast they replace, so the payments telescope and the operator is liable only for the difference between the final forecast and the initial one [1]. For the QLS-LMSR this limits the operator's loss to \(C(\mathbf q_0)\) [2].
5. An interactive example
The simulation below implements the example market: 500 ranges, \(v = 2\) and 500 contracts per range at opening. Three example traders, Alice, Bob and Quigley, can be added in any order. You can also buy or sell contracts yourself, close the market and choose the settlement price.
- Opening
- Trading
- Closed
- Settled
| Paid (₿) | Received (₿) | Net (₿) |
|---|
6. Prediction markets as learning algorithms
The logarithmic market scoring rule on which the QLS-LMSR is built has a precise interpretation in online learning. Chen and Wortman Vaughan show that a cost-function market maker is equivalent to an algorithm for learning from expert advice, in which each outcome is an expert and each trade supplies information about the experts' losses [4]. For the LMSR, the prices \(w_i\propto e^{q_i/b}\) are exactly the weights of the Hedge, or multiplicative weights, algorithm, and every convex cost function corresponds more generally to a Follow the Regularized Leader algorithm. The market maker's bounded loss becomes a no-regret guarantee: over many rounds, the algorithm's average loss approaches that of the best single expert in hindsight. In this correspondence \(1/b\) plays the role of a learning rate. Since \(b\) grows with volume in the QLS-LMSR, a market that has absorbed more trading responds to each new trade with a smaller step.
A second interpretation treats the traders, rather than the outcomes, as the members of an ensemble. Beygelzimer, Langford and Pennock study markets in which every participant sizes bets by the Kelly criterion [5]. They show that the market price is then the wealth-weighted average of the participants' beliefs, and that settlement updates each participant's wealth according to Bayes' rule:
$$\hat\pi=\frac{\sum_k W_k\,\pi^{(k)}}{\sum_k W_k},\qquad\qquad W_k\;\leftarrow\;W_k\,\frac{\pi^{(k)}(\omega)}{\hat\pi(\omega)}, \tag{5}$$where \(W_k\) is trader \(k\)'s wealth, \(\pi^{(k)}\) their belief and \(\omega\) the realized outcome. The market therefore behaves like Bayesian model averaging with bankrolls as prior weights, and its log loss stays close to that of its best participant.
| Ensemble model | Prediction market |
|---|---|
| Base model | A trader, human or automated |
| Prediction | The trader's probability for each range |
| Weight | Capital at risk |
| Combination rule | The cost function |
| Learning rate | \(1/b\), which falls as the market grows |
| Loss function | The logarithmic score, realized at settlement |
These results explain why automated forecasting models fit naturally into such a market. A model enters in the same way as a human trader, by committing capital to a forecast, and its influence on later prices grows or shrinks with its realized accuracy. The market combines human and machine forecasts without anyone having to assign weights to them in advance. Quigley, the third example trader, is such a model: a model that produces a distribution over all 500 ranges and sizes its positions by the Kelly criterion.
References
- [1]R. Hanson. “Combinatorial Information Market Design.” Information Systems Frontiers 5 (2003). pdf
- [2]A. Othman, T. Sandholm, D. Pennock, D. Reeves. “A Practical Liquidity-Sensitive Automated Market Maker.” EC 2010. doi
- [3]Y. Chen et al. “Gaming Prediction Markets: Equilibrium Strategies with a Market Maker.” Algorithmica 58 (2010). doi
- [4]Y. Chen, J. Wortman Vaughan. “A New Understanding of Prediction Markets via No-Regret Learning.” EC 2010. arXiv
- [5]A. Beygelzimer, J. Langford, D. Pennock. “Learning Performance of Prediction Markets with Kelly Bettors.” AAMAS 2012. arXiv
Equation (2) is a rearrangement of the price function given in the full paper and yields identical prices.