Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/quadratic #73

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

dankelleher
Copy link
Contributor

@dankelleher dankelleher commented Aug 8, 2022

A simple quadratic voting plugin, that takes a predecessor vote (and max vote) and applies a quadratic function to them. This has the effect of amplifying smaller votes and dampening larger ones.

Notes:

  • This plugin can be composed with any other plugins, but should be used in association with a plugin that guarantees the uniqueness of the voters, in order to avoid sybil attacks.
  • This PR adds rich JS clients for the Gateway and Quadratic plugins, allowing integrators to make calls such as client.updateVoterWeightRecord(realm, mint, voter), and the client handles wiring up the predecessor accounts.
  • This PR updates solana to v1.17. Accordingly Soteria audit has been removed because it doesn't appear to support this version (it expects bpf-toolchain rather than sbf-toolchain). Please reinstate if possible.
  • Finally, the PR includes a couple of scripts for testing or debugging the gateway and quadratic plugins

@dr497
Copy link

dr497 commented May 2, 2023

@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?

@dankelleher
Copy link
Contributor Author

@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?

Not that I know of - merging is down to @SebastianBor . It has been a while since I delved into this tbh but IIRC it needed just a little refactoring and maybe testing and then it's good to go. I'm happy to help and advise where needed!

Just to point out, this is a very simple form of QV where there are no "multiple-choice" voting options yet. Supporting multiple choice proposals should probably be a separate PR.

@SebastianBor
Copy link
Collaborator

@dankelleher Thanks a lot for the PR. I am also interested in this, do you know if there is any plan in merging this PR? Anyone already using this plugin?

Not that I know of - merging is down to @SebastianBor . It has been a while since I delved into this tbh but IIRC it needed just a little refactoring and maybe testing and then it's good to go. I'm happy to help and advise where needed!

Just to point out, this is a very simple form of QV where there are no "multiple-choice" voting options yet. Supporting multiple choice proposals should probably be a separate PR.

It's a great example of stacked plugin implementation (and I want to keep it for that reason) but I think the solution is too complex for quadratic voting. A better solution would be to implement it directly in spl-gov. We could introduce a flag which would determine how voter_weight is applied.

However the most important thing would be to use the Civic gateway plugin with proof of uniqueness to prevent Sibyl attacks

Note, due to compatibility issues between solana program test 1.17.* and anchor 0.29.0, solana-program-test is currently on a fork.
Note, due to compatibility issues between solana program test 1.17.* and anchor 0.29.0, solana-program-test is currently on a fork.
@dankelleher dankelleher force-pushed the feature/quadratic branch 2 times, most recently from a367030 to b301bcc Compare January 15, 2024 12:51
@dankelleher dankelleher force-pushed the feature/quadratic branch 4 times, most recently from f801dc6 to 0bdd490 Compare January 19, 2024 10:40
… Labs about how to track maxVoterWeight.

A summary of the discussion:

This is an issue that also applies to VSR DAOs, but that it is essentially a UX issue, and relates to the decision of "how to set a quorum correctly"?

Essentially - in "normal" DAOs, you set the quorum as a percentage of the total vote power, where vote power = token supply.

With QV DAOs, the total vote power is a function of total supply and distribution.

If the distribution is wide and egalitarian (uniform distribution of tokens), the total power is higher than if the distribution is narrow and centralised in a few whales (long-tail distribution).

So this leads to two facts:
- calculating max weight is complicated and changes over time - we could do it, but it would require changes in the core program as mentioned.
- setting the quorum as a percentage of the max weight is not that useful, since, depending on the distribution, that percentage may be reachable by one or two whales (note, this is even worse in token-voting DAOs.

As a result, we decided it is currently not necessary to calculate an accurate max weight, and quorum will be determined based on the token supply, with potentially some UI help to explain how that is affected by QV.
…d implement it as needed). This ensures client code doesn't assume plugins have max voter weight records just because getMaxVoterWeightRecordPDA returns something.
…at returns the previous voter weight record in a chain of plugins. This is due to the fact that some plugins (such as VSR) derive the VWR in a slightly different way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants