Robin Hanson invented a wonderful market maker well suited for use in prediction market applications with a long name: the logarithmic market scoring rule market maker, which I’ll abbreviate as LMSR. (In fact, Hanson invented an entire class of market scoring rule market makers, but the logarithmic variant seems the most useful.) Hanson’s two papers on the subject are excellent, but Hanson does not spend a lot of time explaining how LMSR functions as a market maker in the typical sense. Instead, Hanson mostly emphasizes a second, alternate way of thinking about his market maker, as a “sequential shared scoring rule”, which I will not try to explain here. Hanson prefers to describe trader behavior in terms of “changing the price” instead of “buying and selling shares”. In my opinion, most people who encounter LMSR for the first time don’t quite see how beautifully and naturally LSMR can be used as a market maker in a standard prediction market setting. In fact, I am embarrassed to admit that upon my own first reading of Hanson’s papers, I did not fully “get it”. It took my seeing LMSR implemented in practice, by Todd Proebsting at Microsoft Research for Microsoft’s internal prediction markets, to realize how elegantly LMSR can be used as a market maker in an otherwise typical prediction market. LMSR is now being used in several places, including an implementation at InklingMarkets with a wonderfully intuitive interface, the Washington Stock Exchange, BizPredict, and (reportedly) at YooNew. Net Exchange was one of the first to use LMSR, though they seem to favor Hanson’s “change the price” interface over the more widespread “buy and sell shares” interface. As Chris Masse is quick to point out, LMSR has achieved much more widespread use than my own competing invention, the dynamic parimutuel market maker, which so far is being used in only one place: our own Yahoo! Tech Buzz Game.
In this post I will try to explain how to implement LMSR in a way that I believe most people familiar with prediction markets will understand. This interpretation of LMSR is not new: it’s the way Proebsting thinks about LMSR and it’s implicit “between the lines” in Hanson’s papers. But I haven’t seen this interpretation of LMSR written up anywhere, so I’m hoping that others can benefit from this explanation. The following understanding of LMSR was developed over the past few months together with my colleague Yiling Chen.
Suppose there are two outcomes that traders can buy or sell shares of (bet on or against) such that one and only one of the two outcomes is guaranteed to eventually occur. For example, the two outcomes could be “a Democrat wins the 2008 US Presidential election” and “a Democrat does not win the 2008 US Presidential election”. Each share is worth exactly $1 if and only if the trader is correct. In other words, one share of “Democrat wins” pays $1 if, in 2008, a Democrat actually wins the election, and is worthless otherwise. The following description can be easily generalized to any number of (disjoint and exhaustive) outcomes, including the case of combinatorial markets, but for ease of exposition I’ll stick to the two-outcome case.
The market maker keeps track of how many shares have been purchased by traders in total so far for each outcome: that is, the number of shares outstanding for each outcome. Let q1 and q2 be the number (“quantity”) of shares outstanding for each of the two outcomes. The market maker also maintains a cost function C(q1,q2) which records how much money traders have collectively spent so far, and depends only on the number of shares outstanding, q1 and q2. For LMSR, the cost function is:
where “ln” is the natural logarithm function, “e” is the constant e=2.718…, and “b” is a parameter that the market maker must choose. The parameter “b” controls the maximum possible amount of money the market maker can lose (which happens to be b*ln2 in the two-outcome case). The larger “b” is, the more money the market maker can lose. But a larger “b” also means the market has more liquidity or depth, meaning that traders can buy more shares at or near the current price without causing massive price swings.
Traders arrive one at a time and tell the market maker how many shares they want to buy or sell of each outcome. Traders say, for example, “I want to buy 13 shares of outcome 1 — how much will that cost?”, or “I want to sell 250 shares of outcome 2 — how much will you pay me?”. The market maker uses the cost function to answer these questions. The cost to buy 13 shares of outcome 1 is simply C(q1+13,q2) – C(q1,q2). The “cost” to sell 250 shares of outcome 2 is C(q1,q2-250) – C(q1,q2), which will be a negative number (negative cost), meaning that the seller receives money in return for the shares. In general, if a trader wants to buy or sell shares of either or both outcomes so as to change the number of shares outstanding from (q1,q2) to (q1*,q2*), then he or she must pay C(q1*,q2*) – C(q1,q2) dollars. If this amount is negative it means the trader receives money instead of paying money.
Here’s a simple example. Suppose b=100 and no one has purchased any shares yet, so q1=q2=0. A trader arrives who wants to buy 10 shares of outcome 1. The trader must pay:
Now suppose that at some time later, the number of shares outstanding for outcome 1 is q1=50 and the number of shares outstanding of outcome 2 is q2=10. Now the same trader above returns to the market and wants to sell her 10 shares. The trader’s “payment” is:
This is a negative number so it means the trader receives $5.87. So in the end the trader made a round-trip profit of $0.75.
That’s it! Well, almost. If the market maker wants to quote a “current price”, he can. The current price for outcome 1 is:
and similarly for price2. But note that the current price only applies for buying a miniscule (infinitesimal, in fact) number of shares. As soon as a trader starts buying, the price immediately starts going up. In order to figure out the total cost for buying some number of shares, we should use the cost function C, not the price function. (If you remember your calculus: The total cost for buying k of shares of outcome 1 is the integral of the price function from q1 to q1+k. The price function (“price1″) is the derivative of the cost function C with respect to q1, and the cost function is the integral of the price function.)
Finally, although I won’t go into the details here, one can generalize the above so that the market maker can handle limit orders, for example an order to “buy up to 100 shares of outcome 1, each at price less than or equal to $0.80″. But if unfilled limit orders like this are allowed to persist, the market maker logic can get a little complicated.
As I mentioned, Hanson actually invented an entire class of market makers: he shows how to turn any proper scoring rule into a market maker. Yiling Chen and I have derived the cost and price functions corresponding to the quadratic scoring rule. It turns out, however, that the quadratic scoring rule market maker is not very interesting or useful in practice. I’ll save the details for another day. We’re also working on additional classes of market makers that do seem useful, results we hope to report on soon [update: see our paper "A utility framework for bounded-loss market makers"].

Carving a legal niche for prediction markets in the US
In the wake of US authorities arresting two executives of prominent European online gambling companies, and the surprise passage of the Unlawful Internet Gambling Enforcement Act of 2006, the shares of publicly-traded online gambling firms with large US exposure are down 50% or more. Now these companies are selling off their US operations for as little as $1. And it’s not just offshore gambling execs and shareholders who are worried. Many people are lamenting the seemingly dulled prospects of operating real-money prediction markets in in the United States.
In the previous post, I discussed what is legal in the US and what is not. In this post, I’d like to explore the pros and cons of different strategies for carving out a legal niche for prediction markets.
My personal opinion, and likely the opinion of many readers, is that gambling should be legal in the US as a matter of personal freedom, and that the US should follow the lead of the UK in legalizing, regulating, and taxing online gambling. However, as a practical matter we cannot hope for anything close to blanket legalization anytime in the foreseeable future. Here are four less sweeping approaches to drawing the legal boundaries, some more realistic than others.
Robert Hahn and Paul Tetlock have written an excellent op ed in the New York Times calling for special legal distinction for prediction markets apart from gambling laws. They propose an “economic purpose test”, which would legalize prediction markets that have some economic value: either value as an instrument for hedging risk, or “information” value as a predictor of outcomes of significant economic consequence. Hahn and Tetlock argue that presidential betting would pass their economic purpose test, and that sports betting would not pass their test. However, one can argue that sports teams, local sports bars, and even city governments could use sports betting markets to hedge risk. I believe that, as a practical matter, sports betting would simply have to be called out as an exception in any such test.
One argument is to draw the legal lines to outlaw pure chance-based games with a proven mathematical house edge that cannot be overcome. Roulette, craps, lotteries, and other common casino games fall into this category. The flipside would be to argue that any game that might allow a mathematical edge to a player with superior information or superior strategy should be allowed. Sports betting, poker, and, of course, prediction markets fall into this category. There is some precedent for allowing skill-based “gambling” games in many US states, as discussed in the previous post.
Another argument is to distinguish the new betting exchanges from more traditional bookies. Betting exchanges, like BetFair and TradeSports, simply provide a central marketplace for people to trade bets with one another. They collect transaction fees, but their profit does not depend at all on which side of a bet wins or loses. In contrast, bookies can end up with imbalanced exposure and may stand to gain or lose depending on the outcome of the bet. Also, bookies effectively enforce an artificially large bid-ask spread (often operationalized as a “vig” or tax on winnings) to ensure their profitability, while exchanges do not. Executives at TradeSports argue that these distinctions put them in safer legal territory than more typical online gamling operations. I’m not sure that US prosecutors would agree. The argument can sound like Napster’s argument that they were not directly responsible for users of their service who were violating the law.
One might argue that by enforcing strict investment limits, say $500 per person, the risk to problem gamblers is sufficiently minimized. This is part of the “no action” agreement between the Commodity Futures Trading Commission (CFTC) and the Iowa Electronic Markets. An almost opposite approach, but with similar motivation, is to limit participation to individuals with a very large net worth (e.g., millions of dollars). This is the legal cover that many hedge funds use: the supposition is that these individuals “know what they’re doing”, understand the risks, and have enough money to survive the inevitable ups and downs. The CFTC weilds a lighter regulatory hand on exchanges that cater only to the super rich.
In my opinion, although all the above arguments make some sense, the only one with any chance of actually gaining ground in the current legal and political environment is the first one (the “economic purpose test”), perhaps with the additional cover of a low investment cap and special exceptions ruling out sports betting and other stigmatized topics. Many people in the US, including lawmakers, still harbor outdated notions that gambling is a religious sin or has the taint of organized crime. If prediction market advocates want to make progress toward legalization, I believe they will have to distance themselves from gambling and sports betting. Although there is no logical distinction between betting on sports and trading contingent contracts, there is a very real social, political, and legal distinction. Though it can seem unpalatable to support gray and illogical distinctions, the unfortunate reality is that gray and illogical distinctions are the only ones with any practical chance of becoming law.