You are here

Rebooting predicition market for Drupal 7: a simple Parimutuel system

Submitted by greggles on Fri, 11/04/2011 - 08:01


  • Relying on too many contributed modules, which made the stack of technology just too frail when one of those changed

So, I'm hoping that a simpler pariumutuel system (doesn't require matching trades, therefore doesn't require an automated market maker) will allow me a simpler architecture which will reduce the desire to rely on other contributed modules. The biggest drawback to a pariumutuel system is in long term events. If you are betting on something that won't be determined for years your money is tied up until the event passes. If you want to back out of a position you get back exactly your same initial wager and the odds shift. This is a clear drawback, but I feel it could be worth it just to get a working system going sooner.

I'm thinking now about how to build the system on Drupal 7, which opens up several new technology choices in addition to old models:

  • VotingAPI
  • Nodes and fields
  • Fields and entities (a module can create it's own entities...we could do that)
  • Userpoints

I spent a little bit of time (in bed as I woke up it was the first thing on my mind...I must be getting excited again) trying to think about the model. Nodes, Fields and Entities are all powerful tools. But I'm not sure if they provide the right kind of scalable framework for this.

Userpoints would be the form of currency again, most likely. I can't think of much that would change my mind on this unless the module just got horrible in the last 2 years instead of getting better.


  • I can create a Question node with a flag for whether it is open or closed and another field for a close date (if it's known) and a text field with unlimited number of options for the outcomes
  • I can create a node for a wager, which will require an amount (can be updated, revisions enabled of course) which would refer to a specific Question and a field that refers to a specific outcome from the Question (that seems like a new field type: the field_input_reference or something)
  • When a question is closed no more wagers would be allowed, the total would be calculated and proceeds distributed back to users as points

VotingAPI basis:

  • Again there would be a question node with similar metadata fields, but the option fields would become voting api tags (nid-delta?)

Still debating on this. I've been going back and forth on which one to use this morning, but at least it's getting closer.

Add new comment

Filtered HTML

  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.