Integrating Book Orders and Market Makers

No Gravatar

[Cross-posted from Pancrit.org.]

Dave Pennock gave a gentle introduction to the Market Scoring Rule invented by Robin Hanson. In the comments, Sid asked for an explanation of how to integrate the MSR with an order book. Dave asked me privately if I&#8217-d be willing to tackle that, and this post is the result. Robin&#8217-s short note on integrating an order book and a market maker covers a lot of territory very quickly. In Robin&#8217-s defense, it was written to clarify some ideas in the midst of a conversation we were having at the time, and hasn&#8217-t been cleaned up for publication. I&#8217-ll expand on it here so it has a chance of making sense to others. The paper couches things in terms of the MSR, a particular AMM, but none of the implementation depends on which AMM is used.

There&#8217-s a working example of the integration we&#8217-re talking about in the code for Zocalo. The code that does this is currently in transition since I&#8217-m adding support for multi-outcome markets. For the moment, I recommend reading the code for version 375, since the current code is more complex and possibly incomplete. You can either download the complete source code for release 2006.5 of the Zocalo Prediction Market, or browse the code directly using the SVN interface.

The paper starts by giving a very compressed introduction to the idea of a prediction market and market maker (hereafter AMM for Automated Market Maker). Unless you&#8217-re very familiar with the details and the formalisms that Robin uses to describe them, you&#8217-d be better off reading the original papers (Logarithmic Market Scoring Rules, Combinatorial Information Market Design) than trying to pick anything up from the first four paragraphs of the note.

The fourth paragraph slips into the idea of integrating an order book with the AMM he&#8217-s talked about to that point. (&#8221-If instead [the AMM price resulting from buying the entire quantity is higher than the user’s max marginal price], a portion […] could be traded with the market maker, leaving a book order for the remaining quantity&#8221-). From that point, he talks about how to integrate the two markets.

If new orders get the advantage of any order price overlap

In book order systems, if orders arrive asynchronously, you will often see orders that &#8220-overlap&#8221-, i.e. orders to buy at a higher price than the best offer to sell, or orders to sell lower than the best offer to buy. The system has to have policy about what price to transact at in these cases. The system could tell each party that they got the price they requested, and pocket the difference- it could use the book order&#8217-s price or the new offer&#8217-s price- or it could split the difference in the interest of fairness. If any choice is made other than using the stated price of the order in the book, investors have an incentive to carefully submit bids a little at a time (aka &#8220-structure&#8221- their bids) so they won&#8217-t pay more than they have to if new orders should arrive. Robin argued elsewhere (I can&#8217-t find the reference at the moment) that you should just transact at the book order price so that people submitting market price orders don&#8217-t waste their resources and yours on this optimization.

That choice also simplifies the calculation for accepting new offers. As Robin says, &#8220-each book order […] imposes a constraint on the market maker price&#8221-. The AMM should fulfill orders up to that limit, then let trade continue with the book order. This requires a loop, in which you buy from the AMM until you reach the limit imposed by the best order(s), then trade up to the book order&#8217-s available quantity, then go back to the AMM until you reach the next book order. You can see the approach in Zocalo&#8217-s method Market.buyFromBothBookAndMaker(&#8230-). (The method starts at line 237.)

At every step,

  • find the remaining quantity q of the new order
  • find the price p available from the best existing order
  • if the AMM&#8217-s price is no better than the book order, trade up to q with the book
  • otherwise trade with the AMM to the lesser of p or q

The loop stops either when the new order is fulfilled or the price limit specified by the new order is reached.

That&#8217-s the simple version for a one-dimensional AMM. The multi-dimensional version arises if you implement the AMM as described in &#8220-Combinatorial Information Market Design&#8221-. There are two open source implementations of this approach available for reading by hard-core hackers. Robin built an implementation in Lisp, and I wrote a version in E. Neither is more than a demonstration of how the market engine works, since no serious user interface was written for either one.

Rather than attempt to explain how the approach translates to the multi-dimensional case now, I&#8217-d prefer to wait until after I write an explanation of the n-dimensional combination market, and that depends on a gentle introduction to conditional and combinatorial betting which I haven&#8217-t written yet. Having someone ask about Robin&#8217-s note raises my priority for writing these prerequisites.

Other Articles in this series

    PM intro: basic formats (2005-12-30)

  • PMs with Open-ended Prices (2006-01-05)
  • Looking at Both Sides (2006-04-17)
  • Book and Market Maker (2006-04-28)
  • Liquidity in N-Way claims (2006-07-19)
  • Continuous Outcomes using Bands and Ladders (2006-09-20)

Global warming contract suggestion

No Gravatar

How about a contract series as follows, based on NASA&#8217-s Goddard Institute for Space Studies global temperature (C) data for surface air temperature change, using 1950-81 as baseline:

GISS.2007.ANNUAL.MEAN&lt-.50
GISS.2007.ANNUAL.MEAN&gt-.50
GISS.2007.ANNUAL.MEAN&gt-.60
GISS.2007.ANNUAL.MEAN&gt-.70

The data series can be found here. Some pretty graphs here.

graph

Cross posted from CaveatBettor.

My plea to Yahoo! research scientist David Pennock

My Dear Honorable Doctor David Pennock,

Please, give us more choices. We want to be able to choose between:

real-world outcomes and Yahoo! search outcomes

CDA, MSR and DPMM-

– play money (Yootles) and real money (in the U.K., thru a BetFair patnership).

WE WANT FREEDOM, DOCTOR PENNOCK. DON&#8217-T IMPOSE YOUR PREFERENCES ON US. Ever heard of the Statue of Liberty that the French gave to your people, man??

Addendum: I almost forgot. And we want a high level of interactivity between blogs and prediction markets. Plus, we want imaginary prediction markets. Hurry up- we&#8217-re waiting.

Read the last blog posts by Chris Masse:

MESSAGE TO JIM CHANOS: MIDAS ORACLE WOULD PUBLISH YOUR REBUTTAL.

Hello Mister James Chanos,

I&#8217-m Chris Masse, the Blog Administrator and Editor of Midas Oracle .ORG.

I see this message posted at Deal Breaker.com:

No one from &#8220-MidasOracle&#8221- or DealBreaker.com attempted to contact me before running this false and malicious story. Jim Chanos

Posted by: James Chanos | January 10, 2007 12:33 AM

This open letter is to tell you that Midas Oracle is a group blog where 28 post authors have published Op&#8217-Eds, and you&#8217-re more than welcome to have your rebuttal published here, or linked to, whatever you prefer.

For your information, bloggers seldom contact people they write about, contrary to Press journalists &#8212-Steve Roman (the blog author of Insight or Connection – How Kynikos Associates Profited from the Gaming Bill) thus fits the current convention/standard of the Blogosphere. Note that there is a difference between the print Press and the Web-based blogs: a blog is defined as a published conversation, and the person who is blogged about can enter the conversation and let the readers know his/her viewpoint(s). Contrary to the print Press, no editor will censor your &#8220-letter to the editor&#8221-.

Once this blog post is published on Midas Oracle, I will try to send its URL via e-mail.

Chris Masse

&#8212-

External Link: James Chanos: Genius Short-Seller or Politically Well-Connected? Or Is There A Difference? – by John Carney – 2007-01-09

[..] Stephen Roman at MidasOracle.org suspects that there may have been something more at play here than good luck or good research—namely, James Chanos’ political connection. Some of the biggest supporters of anti-online gambling legislation have been the big casino operators, and, of course, the Senator from Vegas—err, Nevada—John Ensign. Now according to Roman, Ensign likely knew that the online gambling legislation was likely to be passed through his connections to Senate leader Bill Frist. What’s more, Roman thinks its very possible that Ensign could have passed this information on to Nevada Attorney General George Chanos, who just happens to be the cousin of Kynikos’ James Chanos. [&#8230-]

Is any of this true? We have no idea. It wouldn’t be the first time that this sort of “honest graft” has helped make someone rich or richer. And the question of the legality of trading on inside information about upcoming legislation has long been debated. Frankly, the whole chain of information Roman proposes seems unnecessary. Even if it didn’t happen exactly like that—Frist to Ensign to Chanos to Chanos—it wouldn’t be surprising if James Chanos connections to Nevada’s gambling community helped him anticipate the legislation.

&#8212-

Addendum:

Contact Form

Read the previous blog posts by Chris. F. Masse:

Contract on US Economy going into Recession – REDUX

Last time, when I said that there was a problem with the TradeSports chart, nobody believed me and Caveat Bettor treated me like a decerebrated idiot. See the problem??? The TradeSports chart spans on one day, only.

Let&#8217-s try again the TradeSports code lines (pasted here in order to generate a dynamic chart &#8211-i.e., a chart that will update itself in the future):

Chart

There is OBVIOUSLY a technical problem.

Anyway.

James Hamilton has managed to better the TradeSports-InTrade US recession contract:

Given the concerns expressed by Stephen Kirchner about the original details of the Tradesports contract, I suggested to Tradesports a tighter definition of what it means for the U.S. to go into a recession, which they&#8217-ve now adopted. The current contract declares that the U.S. will be said to have experienced a recession in 2007 if the Commerce Department numbers as reported on February 15, 2008 show 2 consecutive quarters of negative real GDP growth between 2006:Q4 and 2007:Q4.

Here&#8217-s what Stephen Kirchner had written:

As is often the case with prediction markets, the contract specification raises more questions than it answers. There is no reference to whether the contract expires with the advance, preliminary or final GDP releases. The potential expiry with the Q3 release still leaves open the possibility of a recession in 2007 as a result of revisions to historical data. You could be right about a recession in 2007 and still lose money with this contract specification. And why do we need the media to confirm data released by the BEA? Perhaps Intrade are trying to avoid the problems that arose with their North Korean missile launch contract.

TradeSports-InTrade John Delaney should take advice from economists BEFORE setting up any economics-related prediction markets. He&#8217-s probably not humble enough to do that. I have always said that creating prediction markets requires a dual competency, which prediction exchange managers are unlikely to possess &#8212-they are managers, not thinkers, I will tell you. Thus, the need for experts advising prediction exchanges &#8212-that&#8217-s how the &#8220-humility&#8221- factor comes in.

Addendum: Professor James Hamilton of Econ Browser tells me that he has slightly modified the TradeSports code line to read now:

Price for US Economy in Recession at TradeSports.com

Finally!!!!!! It works.

Addendum: Professor James Hamilton says, in a comment:

CEO John Delaney has been extremely gracious in all his dealings with me, and responded very quickly to my suggestions on the recession contract. He’s also invited me to consult with them prior to launching future economic contracts. So I think he’s on board for your message.

OK.


Author Profile&nbsp-Editor and Publisher of Midas Oracle .ORG .NET .COM &#8212- Chris Masse&#8217-s mugshot &#8212- Contact Chris Masse &#8212- Chris Masse&#8217-s LinkedIn profile &#8212- Chris Masse&#8217-s FaceBook profile &#8212- Chris Masse&#8217-s Google profile &#8212- Sophia-Antipolis, France, E.U. Read more from this author&#8230-


Read the previous blog posts by Chris. F. Masse:

  • Are David Pennock’s search engine prediction markets the worst marketing disaster since the New Coke?
  • Midas Oracle is incontestably [*] the best vertical portal to prediction markets.
  • Comment spam paid by Emile Servan-Schreiber of NewsFutures-Bet2Give
  • BetFair Games needs a Swedish provider to develop its gambling offerings.
  • When Markets Beat the Polls – Scientific American Magazine
  • Robin Hanson has some fanboy in India. Great. Tiny caveat: The parroting Indian writer does not acknowledge Robin Hanson by name.
  • Molecular Nanotechnology