Payout System
Schemes for selecting winners and their prizes in a pool betting application.
This is used at Picklive.
See also: Picklive tech blog.
Example:
class Entry
attr_accessor :points
def initialize(points)
self.points = points
end
end
entries = [34, 61, 73, 17, 45, 18, 93, 102, 46].map{ |points| Entry.new(points) }
pot_amount = 1000
payouts = PayoutSystem.calculate(pot_amount, entries, :podium_split, :points)
Available payout systems
- winner_takes_all - 1st place wins the pot
- podium_split - 1st, 2nd, 3nd place win 70%, 20%, 10% of the pot
- minimum_to_fraction - first 25% of players get back a minimum (this
can be their stake), and the top 3 splits the remaining sum according
to podium_split rules