Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Quadratic Voting

Create a poll, then spend voice credits on the options you care about -- the Nth vote you stack on one option costs N^2 credits out of a fixed budget of 100 per poll, so spreading support across options is cheap but dominating one gets steep fast.

Polls

no polls yet -- call CreatePoll(question, "opt1,opt2,...") to start one.

How to use

  1. CreatePoll("Best pizza topping?", "pineapple,mushroom,pepperoni") -- returns a poll ID.
  2. Vote(pollID, optionIdx, delta) -- e.g. Vote("1", 0, 3) buys 3 votes on option 0 (costs 9 credits); a negative delta sells votes back for a refund.
  3. ClosePoll(pollID) -- the creator ends voting.

View a poll at this realm's path plus its ID (e.g. .../qvote:1), or one voter's standing in it with .../qvote:1/g1youraddress....