¶ ↑
Footy Shares<img src=“https://travis-ci.org/bretthughes12/footyshares.png” />
This project is a Rails application designed to manage user participation in a Football Tipping competition based on a ‘share investing’ model.
Users sign up to the site and indicate how many starting shares they wish to purchase (note: this is not a financial application - management of the financial aspects is handled manually).
Then, each week of the competition, users nominate which teams they wish to ‘invest’ their shares in. At the end of the round, shares invested in winning teams are retained and shares invested in losing teams are lost. The total prize pool is redistributed across the remaining shares, thus increasing the ‘share price’ of the remaining shares.
This project was written specifically to cater for the AFL Finals series in Australia, and can be adapted to other needs.
¶ ↑
Sample Share Tipping RulesPrior to the Finals, shares are sold in lots of 50, at 10c per share:
-
$5 = 50 shares
-
$10 = 100 shares
-
$15 = 150 shares
-
Etc…
A minimum of 50 shares can be purchased.
Each week of the AFL Finals you will be required to invest your shares in participating teams. Shares can be invested in as many teams as you like, across as many games as you like, but ALL your shares must be invested each week (ie. you can’t ‘save’ shares for a future week).
Once the week’s games are complete, any shares invested in losing teams are lost. The shares that remain then increase in value.
¶ ↑
ExampleJane has 100 shares, purchased for $10. In week 1 of the Finals she invests them as follows: Hawthorn 20 shares Collingwood 10 shares Sydney 0 shares Adelaide 50 shares West Coast 10 shares North Melbourne 10 shares Geelong 0 shares Fremantle 0 shares Hawthorn, Sydney, West Coast and Fremantle win, so Jane now has 30 shares left to invest in week 2.
In the Grand Final you must invest your shares in ONE team only. Those who invest in the winner will get a return equal to their total shares remaining, multiplied by the final share value.
Shares 35 Share price $2.34 ------ Return $81.90 ------
¶ ↑
Model HierarchyRound |__ Match |__ Team |__ Share | User____|
In each round of the competition, there can be a number of matches. Each match is between two teams.
In each round, the user can allocate their shares to any of the teams playing in that round’s matches.
¶ ↑
InitialisationTo reset the database for a new year:
rake db:reset