Pages

Monday, 19 April 2010

Domain model

Betting Exchange - "...is a form of bookmaking in which the operator offsets its risk perfectly through technology, such that the effect to the customer is that customers are seen to bet between themselves..." - from Wikipedia.

Market - "...The market is where you place a bet on an event. Any given event, such as a soccer match, may have a number of different markets: for example, Match Odds, a Handicap and First Goalscorer markets. This is the place to view the odds and have a bet..." - from Betfair help.

Bet - "...A ‘Back’ bet is a bet on something to happen – a horse to win a race, a football team to win, a person to be evicted from Big Brother etc. It’s just like the bet you’d regularly place with a traditional bookmaker or tote, or even with your mates..." - from Betfair help. "...Laying a bet means you are betting on something not to happen – a match not to end in a draw, a horse not to come in first, a rugby team not to win by over 7 pts etc..." - from Betfair help

Historical market data - Represents the whole market life cycle: market creation, bet placement, turning market in play, bet placement in play and market settlement. It allows to replay a market from the past.

Trader - Responsible for analysing market and taking appropriate bet placement decision. The aim of bet placement is to guarantee the highest profit with the lowest risk. There are two types of traders, a real trader that is represented by human and artificial trader that is represented by computer software. The main aim of this project is to provide a simulation environment for testing artificial traders.

Expected profit - This is a measure that tells, what would be the profit in a long term if the same market was processed many times. For instance if the expected market profit is 10, then it means that for 100 'exactly the same' markets the profit would be 1000. It may happen that for the first market the profit will be -23 and for the next market it will be 12, but in total, based on a theory of probability it should be approximately 1000.

Component design

Components:

User - A person who is using the market simulation. Usually it's a market analyst or a real trader.

Simulator App - Provides a command line interface to the market simulation. Read the configuration of the historical market data and the trader implementation, runs simulation and displays expected profit report on the screen.

Simulator - Does exactly the same as a simulator application, but provides application programming interface instead of command line interface.

User starts the market simulator giving the path to the file with the historical market data and the name of the trader implementation class. After the market simulation is finished the market expected profit report for the trader is printed on the screen.

The Simulator Application calls the Simulator component with the input parameters provided by the user.

The Simulator component reads the file with historical market data and for each historal market event, calls both MarketEventProcessor and Trader. After all historical market events are processed, it calls the ExpectedProfitCalculator to get the market expected profit report.

Deployment design

Java VM - The Betting AI application will be written in the Scala programming language that is running within the Java virtual machine.

Scala - The scala language distribution, contains scala libraries that are required to run scala applications.