Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

52
Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock

Transcript of Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Page 1: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Market Madness: Implementing a 9.2 quintillion outcome prediction market

David Pennock

Page 2: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

A (2-outcome) prediction market

• A random variable, e.g.

• Turned into a financial instrument payoff = realized value of variable

$1 if $0 if

I am entitled to:

2010 the warmest year on record?(Y/N)

2010 thewarmest

not thewarmest

Page 3: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

http://intrade.com

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.2010

Page 4: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-4

Another example: Options Options prices (partially) encode a probability

distribution over their underlying stocks

stock price s10 20 30 40 50

call20=max[0,s-20]

payoff

call30=max[0,s-30]

call40=max[0,s-40]

Page 5: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-5

Another example: Options Options prices (partially) encode a probability

distribution over their underlying stocks

stock price s10 20 30 40 50

call20

payoff

- 2*call30 + call40

“butterfly spread”

Page 6: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-6

Another example: Options Options prices (partially) encode a probability

distribution over their underlying stocks

stock price s10 20 30 40 50

call30

payoff

- 2*call40 + call50

Page 7: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-7

Another example: Optionscall10 - 2 call20 + call30 = $2.13 relative

call30 - 2 call30 + call40 = $5.73 likelihood of falling

call30 - 2 call40 + call50 = $3.54 near center

stock price s10 20 30 40 50

payoff

$2.13 $5.73 $3.54

Page 8: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Reinventing the wheel

• Put prices:CDF (PDF) of stock price

• Butterfly spreads:discrete approx of PDF

• PDF of stocks are ~lognormal

Page 9: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Reinventing the wheel

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

lognormal(u=3.67, =.205)

Bid,ask,mid of butterfly spreads

Put pricesBest fit lognormal

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 10: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The outrage

• What about call prices?ENTIRELY REDUNDANT!

• I know that, you say: put-call parity

• From an information standpoint, they are useless

• From a trading standpoint, they might be useful, but only because markets are poorly designed

Page 11: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The outrage II

Range bets require four trades

– Four commisions, four bid-ask spreads

– Execution risk

stock price s10 20 30 40 50

call20

payoff

- 2*call30 + call40

“butterfly spread”

Page 12: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-12

Example: Options

YHOOstock price s

10 20 30 40 50

payoff

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 13: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-13

Example: Options

YHOOstock price s

10 20 30 40 50

payoff

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 14: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

AAAI’04 July 2004 MP1-14

Example: OptionsQuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 15: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The thesis

• In a well designed (derivative) market

information is everythinginformation is the only thing

• Contrapositive:redundancy = poor design

Page 16: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Continuous double auctionUber-hammer of the financial world

• Used everywhere– Stocks, options, futures, derivatives

– Gambling: BetFair, InTrade

• Related bets? Just use two CDAs– Max[YHOO-10], Max[YHOO-20]

– Horse wins, Horse finishes 1st or 2nd

– “Power set” instruments: Mutual funds, ETFs, butterfly spreads, “Western Conference wins”

– Treats everything like apples and oranges, even ‘fish’ and ‘fish and chips’

Page 17: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Continuous double auctionUber-hammer of the financial world

• CDA was invented when auctioneers were people

• Had to be dead simple

• Today, auctioneers are computers...

• ...Yet CDA remains the standard

Page 18: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Example:

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 19: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Example: Bet365

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 20: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearchExample: Y! Predictalot

Page 21: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

9.2 quintillion outcomes

Example: Y! Predictalot

Page 22: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

The pitch (to gamers)

• Predict any property2263 possible in theory [gogol,gogolplex]• Duke wins >3 games• Duke wins more than UNC, less than NCST• Sum (seeds of ACC teams in final8) is prime

• We’ll instantly quote odds for any of them• Effects related predictions automatically

• Predict Duke wins tournamentOdds Duke wins rnd 1 goes up

Page 23: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

The pitch (to economists)

• Information is everything• Traders (people) focus on information

Provide it in whatever form they like• Mechanism (computer) handles logical &

Bayesian propagation - what it’s good at

• No redundancy, no exec risk, everything is 1 trade

Page 24: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Overview: Complexity Results

Permutations Boolean Taxonomy

General Pair Subset General 2-clause Restrict

Tourney

General Tree

Auction-eer

NP-hard

EC’07

NP-hard

EC’07

Poly

EC’07

NP-hard

DSS’05

co-NP-complete

DSS’05

? ? ?

Market Maker

(LMSR)

#P-hard

EC’08

#P-hard

EC’08

#P-hard

EC’08

#P-hard

EC’08

Approx

STOC’08

#P-hard

EC’08

Poly

STOC’08

#P-hard

AAMAS‘09

Poly

AAMAS‘09

Page 25: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

LMSR market maker

• Robin Hanson: Logarithmic market scoring rule market maker

Event = E = e.g. Duke wins > 3Outcome = o = complete unfolding of tourn

oEeqo/b

oTRUEeqo/bPrice of E =

Page 26: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

LMSR market maker

• oEeqo/b

oTRUEeqo/b

• Impossible: Store 263 numbers

• Complex: Sum over 263 numbers

• Doable: Approx sum over 263 nums*tricks required to do it well/fast

Page 27: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Main loop

Input: event E

for 1 to NUM_SAMPLESsample oforeach bet (F,qF)

qo+=qF if oFnumer += eqo/b/p(o) if oEdenom += eqo/b/p(o)

return numer/denom

Page 28: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Other market maker functions

• Point price is all we need!

• From price we can compute

– Total cost of any number of shares qE

– Number of shares purchasable for any dollar amount (inverse cost)

– New price after purchasing qE shares

Page 29: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Sampling

• Sampling is accurate when outcomes are chosen proportional to eq/b

• Can’t be done (#P-hard)

• Can sample proportion to q, if size of event is known

• For now, we sample according to seed-based prior fit to historical data

• Next: Metropolis-Hastings

Page 30: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Sampling

• No guarantees

• Erratic convergencee10 dwarfs e8

• Linear scan of all bets in inner loop!

• Now getting serious about improving sampling: 1) fast, 2) stable, 3) accurate

Page 31: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Eval

• If E is a snippet of code, then testingoE requires an ‘eval’ of the code

• Slow in interpreted languages + can be gamed + serious security risk

• Proceeded in phases: 1) Mathematica, 2) PHP, 3) Now implemented a mini language parser in Java: much faster

Page 32: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Demo

• With Mani Abrol, Janet George, Tom Gulik, Mridul Muralidharan, Sudar Muthu, Navneet Nair, Abe Othman, David Pennock, Daniel Reeves, and Pras Sarkar

• Yahoo! Application Platform– Takes care of login/auth, friends, sharing

– Easy to create; good sample code;Google open social

– Small view on my.yahoo, yahoo.com (330M)

– Activity stream can appear across Y!(e.g., mail, sports, finance, profiles)

Page 33: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The modal dialog opens with a screen to select a

prediction type

The modal dialog opens with a screen to select a

prediction type

Example: Y! Predictalot

Page 34: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

On selecting the template for prediction type the other

controls are displayed progressively

On selecting the template for prediction type the other

controls are displayed progressively

Example: Y! Predictalot

Page 35: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Here the user then sets the prediction parameters, but

note that the ‘make prediction’ button is disabled

till all parameters are set

Here the user then sets the prediction parameters, but

note that the ‘make prediction’ button is disabled

till all parameters are set

Example: Y! Predictalot

Page 36: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Odds are calculated only after the user finalizes on

the prediction

Odds are calculated only after the user finalizes on

the prediction

Example: Y! Predictalot

Page 37: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Example: Y! Predictalot

Page 38: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Finally once investments are placed the ‘Make prediction’

button gets enabled.

Finally once investments are placed the ‘Make prediction’

button gets enabled.

Example: Y! Predictalot

Page 39: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Example: Y! Predictalot

Page 40: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

What’s next

• Road to March: Built it, now we hope you come! (+ promo from Y!Sports)

• Road to June: World CupThen IPL, NFL?, Oscars?, Politics?

• Sampling tricks: art and science

• MM to revenue positive: proof of concept

• Flexible market maker: Abe Othman

• Other price functions; dynamic parimutuel

• Open puzzles: integrating limit and market orders, interval bets on real line

Page 41: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

More

What is (and what good is) a combinatorial prediction market?

http://blog.oddhead.com/2008/12/22/what-is-and-what-good-is-a-combinatorial-prediction-market/

Page 42: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

A research agenda:

Chance Tech• Technology to

• Manage chance: prediction, finance• Mitigate chance: insurance• Manufacture chance: gambling

• In: Wisdom of crowds, prediction markets, stock picking, money management, online betting exchanges, computer poker, custom insurance, adversarial ML

• Out: Roulette, human poker, chess

Page 43: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

A research methodology

Design Build Analyze

HSXNFTS

WSEXFXPS

Page 44: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

Examples

Design

• Prediction markets– Dynamic parimutuel

– Combinatorial bids

– Combinatorial outcomes

– Shared scoring rules

– Linear programming backbone

• Ad auctions

• Spam incentives

Build Analyze

• Computational complexity

• Does money matter?

• Equilibrium analysis

• Wisdom of crowds: Combining experts

• Practical lessons

• Predictalot

• Yoopick

• Y!/O Buzz

• Centmail

• Pictcha

• Yootles

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 45: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The evolution of markets

• Phase 0: Invention, manual execution

Auctions

Finance

WALL STREET

Advertising

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.QuickTime™ and a

TIFF (Uncompressed) decompressorare needed to see this picture.

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

bookstores, banks, grocery stores, ...

Page 46: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

The evolution of markets

• Phase 1: Computers mimic it(Cheaper, faster)

Auctions

Finance

ECN

AdvertisingQuickTime™ and a

TIFF (LZW) decompressorare needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Amazon, ATMs, auto checkout, ...

Page 47: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

The evolution of markets

• Phase 2: Computers improve it(Cheaper, faster, better)

AuctionsFinance

Advertising

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Source: Sandholm, T. “Expressive Commerce andIts Application to Sourcing: How We Conducted$35 Billion of Generalized Combinatorial Auctions.”AI Magazine, 28(3): 45-58, 2007

Expressive auctions for chemicals,packaging, ingredients, technology,services, medical, transport, materials, ...

custom Amazon, e-banking, RFID, ...

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

QuickTime™ and aTIFF (LZW) decompressor

are needed to see this picture.

Page 48: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

Phase 0

Mechanism(Rules)

e.g. Auction,Exchange, ...

Page 49: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

Phase 1

Mechanism(Rules)

e.g. Auction,Exchange, ...

Page 50: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

Phase 1.5

Mechanism(Rules)

e.g. Auction,Exchange, ...

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Page 51: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

Phase 2

Mechanism(Rules)

e.g. Auction,Exchange, ...

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Page 52: Market Madness: Implementing a 9.2 quintillion outcome prediction market David Pennock.

ResearchResearch

Phase 2

Mechanism(Rules)

e.g. Auction,Exchange, ...

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Stats/ML/OptEngine

Advertising, Finance, ...