Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prediction Market algorithm

Tags:

algorithm

I'm trying to build my own prediction market, and I'm thinking about algorithms. That is to say, how to adjust the price of a contract based on the amount of call and put orders. The basic algorithm I am using now is of two kinds:

For yes/no events (i.e., either the events happens or doesn't) I am just taking the percentage of people who say it will happen, and make that the contract price. If 90% say it will happen, the price in $90 (fake money). The contracts cash out at $100 if the event occurs, $0 is it doesn't.

For events that have a certain value (let's say a athlete's "power rating"), I set an IPO (my guess as to where the thing will cash out) and the apply a percentage increase to the IPO. So if there are 80% more calls than puts then I add 80% to the IPO. I add a little stabilizer so that the early orders don't cause huge jumps (i.e, the first order doubling the price).

Bear in mind this isn't a real market, the players don't trade contracts, they just make call or put orders against the system.

The first thought I had was that I should weigh the more recent calls and puts as they have nore relevant information presumably (like say the athlete just broke his foot). These guys would know more than the guy who bought a contract three months ago.

Any other ideas?

like image 617
cerhart Avatar asked Apr 03 '09 11:04

cerhart


2 Answers

Option pricing is well studied. Have you read about Black-Scholes and Binomial models? This will help you determine the way price moves up/down in a perfect market.

There are then different type of options -- the vanilla Call/Put (American/European), exotic options, option chains etc. Which ones do you plan to include?

From your description in the last few paragraphs, it looks like you are trying to replicate a Market Maker model of trading. You may want to read up on actual market models (including the one mentioned in the previous statement) before diving in.

like image 80
dirkgently Avatar answered Sep 23 '22 02:09

dirkgently


I'm currently reading "Market Microstructure Theory" by Margaret o'Hara. It's a dense book, but provides a good overview of (relatively) recent theoretical studies on how market prices are set.

The first though I had was that I should weigh the more recent calls and puts as they have nore relevant information presumably (like say the athlete just broke his foot). This guys would know more than the guy who bought a contract three months ago.

I don't think you should do this. The trader who knows that the athelete has just broken his foot is an "informed trader", and will use this information to buy/sell a position - if there are no limits on the amount he can trade, then he should trade an infinite amount. Doing a simple average of trades therefore gives you the "correct" price.

like image 33
endian Avatar answered Sep 19 '22 02:09

endian