R – Prediction Market algorithm

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?

Best Solution

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.