Archive for April, 2006

Market Design: Book and Market Maker

April 28th, 2006 by Chris Hibbert

There are two basic ways of handling incoming orders: keeping standing orders in a book against which market orders can be entered, or having a market maker that accepts orders at its current price and adjusts the price after each order. It’s also possible to combine the two, though that hasn’t been done in very many of the existing markets. (Pennock mentions that the combination is used in finance, but doesn’t give examples.)

Book orders match our mental model of the stock market. The basic idea is that traders are allowed to enter an order to buy or sell at any price. If they offer to buy at a price above (or sell below) the current clearing price (and there are enough shares available), then they make an immediate trade. If they offer to buy at a lower price (or sell higher) then the order is recorded and displayed to later traders. It’s also possible that the market will partially satisfy the new order because the new order specifies more volume than the matching book orders. Different policies might apply in those cases: partially filling the order and placing the remainder as a book order; dropping the remainder; or producing an error message and requiring that the trader specify either that the whole order should be filled or that a price limit shouldn’t be exceeded. On the stock markets, these are called markets orders and limit orders. A market order buys from existing book orders, accepting the market price, while a limit order specifies the highest price at which the trader is willing to buy (or the lowest sell price).

There is one difference in interpretation that matters more in prediction markets than stock markets. Most prediction markets interpret the limit price as the highest incremental price that should apply: no shares should be purchased beyond that price. But it’s also possible to interpret the price as a limit on the aggregate price: if some shares are available below that price, then some could be purchased above the price as long as the average price for the order is below the limit. On a prediction market this might be against the trader’s intent, since it could have the effect of pushing the current price significantly above the limit the trader specified.

There is some risk to entering a book order: market conditions might change, new news might become available, making the trader wish she hadn’t left the standing order. Presumably for this reason, many traders only enter market orders. But in thin markets (most prediction markets are thin; even most stocks are thinly traded most of the time) there can be a gap between the best buy offer and the best sell offer. If there’s always a 5% gap between the best offers on each side, then price takers (those who accept the price the market makes available) pay 5% more than price makers (those who enter book orders, thereby setting the market’s prices). Market volatility determines whether that price difference is a bigger effect than the effect of the changing markets. This makes it valuable for market operators to encourage traders to place book orders. TradeSports charges fees only for price takers.

Markets orders are usually limited by the amount of (real or play) money a trader has in her account. Book orders can be limited in different ways. Most markets allow total orders in all markets up to the user’s balance. The Foresight Exchange (FX) allows orders in each market up to the user’s balance. When trading reduces the user’s cash, FX reduces book orders in any market exceeding the new limit. TradeSports allows total orders up to the user’s balance, and gives additional allowance for the expected value of current holdings. Robin Hanson’s Combinatorial Information Market Design does an even better job of allowing the trader to invest in mutually exclusive outcomes because of the way it tracks assets.

These are all ways of further encouraging more book orders. As long as the market operator ensures that the user’s balance isn’t exceeded, they don’t entail more risk. To the trader, they will sometimes cause orders to disappear just as you try to trade with them, but this isn’t different from someone else accepting the offer before you, or the owner canceling the order while you submit yours. TradeSports’ margin trading allows more trading, but requires that the market operator take on some risk.

The alternative to maintaining an order book is to have an automated market maker. Market makers in stock markets ensure the market is liquid by always having a published price at which they will buy or sell. They make money by maintaining a spread between the prices at which they buy and sell; the quoted price is the price at which you can buy from them. They set the price according to their beliefs about the current demand for the asset, and change the price as their opinion (or their exposure) changes.

Automated market makers set the price according to a rule that tells them how much to raise (lower) the price when a buy (sell) order is processed. A really simple rule would be to buy or sell a single coupon at the current price, and change the price by a constant amount. Run this way, the market maker’s price would bounce around a lot as different traders traded with it, so it often takes a larger volume of trading to move the price as you approach the extremes.

If the market maker bases its prices on a rule that produces consistent prices whether buying or selling, it can sell an unlimited number of shares while limiting its losses. This only works if the market maker is integrated with the market; a user agent can arbitrage, but can’t limit the amount of its losses if it doesn’t have priority in getting its orders into the queue.

The market maker can also follow completely different rules. Dave Pennock’s Dynamic Parimutuel Market (DPM) adjusts the price to ensure that traders on the winning side of a question will split the total value invested up to that point. The standard price rules ensure that the currently quoted market odds are also the incremental price at which you can buy or sell shares, which gives traders an incentive to trade whenever the price is different from their estimate of the odds. The DPM market doesn’t have this incentive structure, as the price and the current payoff vary from one another.

A weakness of algorithmic market makers is that they don’t adjust well as the volume of trading changes. The algorithm is parameterized by a constant that controls how quickly prices move in response to trading. When the market has many participants, you want the prices to move more slowly in response to trading than when there are only a few traders. If you choose the wrong constant, then it will be too hard to move the price in a think market (the price will remain near 50 even when sentiment wants to move it away), or in a thick market it might move back and forth too often. Order books work well in thick markets (there are plenty of offers for people to trade with), but less well with fewer traders. Combining the two should produce markets that work well in both cases. (Robin Hanson made a similar point about combining simple scoring rules with simple markets to produce his market scoring rules.)

In order to run a market with both a market maker and book orders, you have to ensure that the market maker’s orders get priority and that the book orders are satisfied in the correct order as the market maker’s price changes. The intuitive model is that you track queues of buy orders and sell orders, each sorted by the offered price. The market maker can freely trade and adjust its price as long as the price remains between the highest offer to buy and the lowest offer to sell. If the market receives a new offer that would move the price past either best offer, the market maker trades first, until it reaches the price of the best offer, then the book orders are used up. If the new offer hasn’t reached its limit, the process iterates. (Robin Hanson and I discussed how to implement this for his Combinatorial Market in early 2003, resulting in his draft article.) This is all fairly straightforward if the market sells fractional shares (the stock exchanges work that way, why would it confuse traders?). I don’t know of a way to use continuous prices if the market insists on trading only whole shares.

Using a market maker will increase the number of trades that are possible, especially when the markets are thin or many traders are reluctant to enter book orders. Adding book orders makes it easier for the market to adjust to increasing volume. If the initial constant used by the market maker is appropriate for a thin market, the book orders will play a more significant role as the market gets thicker, ensuring that prices don’t gyrate too wildly.

Book Only

Maker only

Both

Zocalo currently integrates the two. When creating a market, book orders are always allowed, and the market creator can decide whether to add a market maker or not. While writing this article, it occurred to me that I should also allow markets with a market maker and no book orders.

Zocalo Release with Persistence

April 18th, 2006 by Chris Hibbert

A new release of Zocalo is available (Here’s a patched release) on SourceForge. Zocalo now supports long-lived Prediction Markets. The previous releases had general support for prediction market trading, but the original packaging was focused on enabling lab experiments for economists. That version has been in use at George Mason since last fall, and they continue to run new experiments using the software.

The new code has two major features: transaction history charts are displayed using JFreechart, and a database has been integrated (using Hibernate) so all data is persistent. This means it is now possible to use the code to run long-lived Prediction Markets. The code currently allows anyone to create new claims. The next important development feature is to add login securty. (Currently, no passwords are required.)

Once accounts have some security, I’m hoping to start running Zocalo as a public server (If you have suggestions for a domain, please send me mail privately) where people could use it for internal markets (e.g. inside a business). There will probably be a period during which I limit the number of groups using it so I can shake out any bugs. But the code will be available so people will be able to run their own copies even as we continue to improve the interface and add features.

There is lots of work left to do, but I’m hopeful that it will soon be good enough to use, and that others will start helping develop the code once we reach that point.

Looking at Both Sides

April 17th, 2006 by Chris Hibbert

NewsFutures has (always had) an interesting feature in its user interface that I want to highlight. I want to explain the difference so I can rely on it in my explanation of other market formats. Sharks Over Kings Whenever they create a new (binary) claim, they write a description of each outcome phrased in positive terms. When they offer a claim on the San Jose Sharks playing the Los Angeles Kings (tonight at 7:30), the two positions are “Kings over Sharks” and “Sharks over Kings”. Whenever you are looking at the market screen that allows you to buy claims, you only see one side of the market (”Sharks over Kings”, for concreteness). If you don’t have a position in the claim, you can only buy the claim. If you have positive assets (from this viewpoint), then you are also offered the option of selling some. But there’s always a button that lets you look at the claim from the opposite point of view. Once you click the button, you see things from the viewpoint of “Kings over Sharks”. If you don’t have any assets, or all your assets are in “Kings over Sharks”, You can still only buy.

When you switch viewpoints, the prices in the order book invert. if the prices were X$65 offered and X$93 asked when looking at “Sharks over Kings”, then it will be X$7 offered, X$35 asked when looking at Kings Over Sharks “Kings over Sharks”. I really like this way of presenting the prices, but it shouldn’t apply only to binary outcomes. It’s useful to be able to think of the prices inverting in this way when you talk about multi-outcome claims as well.

The most common way to present a single binary outcome is to phrase the question in a positive sense, and have a single scale for quoting odds. This means that people betting against the proposition have to subtract from 100 to figure out how much they’re spending or earning.

NewsFutures’ interface simplifies this interaction for the user. There’s a secondary benefit, in that it’s particularly helpful to the seller, and people are more reluctant to bet against outcomes than in favor of them.