Voting threshold

Define criteria that users have to meet in order to be eligible to vote.

Suppose you want to restrict the ability to vote within your community for example to prevent bots from affecting the results or to prioritize members with higher stakes in your organization. In that case, you can do so by setting up Voting Strategies or a combination of Voting and Validation Strategies for your space.

To recap what Voting and Validation Strategies are:

Validation Strategies are a way to define who is allowed to vote on a proposal or create a new one.

Voting Strategies calculate how much Voting Power each user has.

Voting Validation

This solution is a combination of any Voting Strategy/-ies and Voting Validation.

Defining the required threshold of the user's Voting Power can be set up simply and leverage the Voting Strategies used in the Space.

Go to Space Settings and open the Voting tab. At the bottom you can find the Validation section:

Basic Voting Validation

Select the Basic Voting Validation.

This way you can easily define how much Voting Power is required for the users to cast votes on Proposals in your Space. Voting Power is calculated on the basis of the Voting Strategies set for your Space.

For example, if your Voting Strategy is erc20-balance-of and a user holds 20 tokens, their Voting Power will be 20 and they will be eligible to vote with the Basic Validation set at 10.

If they hold 5 tokens, they won't be able to cast a vote as it's < 10 VP.

Gitcoin Passport Validation

Select the Gitcoin Passport Validation.

This Validation allows you to set requirements by checking the Gitcoin Passport stamps which serve as validation for the user’s identity and online reputation. You can select individual or multiple stamps that matter for your space. You can also decide if they need to meet all of these criteria or only one.

Voting Strategies

It is also possible to set a required threshold directly through a Voting Strategy.

We highly recommend the first approach of using a Validation Strategy as it allows higher flexibility and is easier to maintain if the Voting Strategies are changed in the Space Settings.

You can use it with ERC-20 and ERC-721 tokens.

The strategy specifies the minimum balance required for a single token held in the user's wallet.

Let's have a look at an example below. In order to be eligible to vote users are required to hold at least 20 DAI at the snapshot of proposal creation.

Strategy setup:

{
  "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "symbol": "DAI",
  "decimals": 18,
  "minBalance": 20
}

If you are using this strategy for an NFT, make sure to set the decimals to 0 (zero).

You can test it out in the Playground on Snapshot:

You can use it with ERC-20 and ERC-721 tokens.

This strategy allows you to define multiple thresholds and allocate Voting Power at each level.

In the example below, whoever holds less than 1 unit of the token will have 0 Voting Power.

Users holding more than 1 but less than 4 units of the token will have 1 Voting Power.

The maximum Voting Power per user will be fixed at 4 no matter how much of the token they own.

Strategy setup:

{
  "address": "0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d",
  "symbol": "LAND",
  "decimals": 0,
  "thresholds": [
    { "threshold": 1, "votes": 1 },
    { "threshold": 4, "votes": 2 },
    { "threshold": 11, "votes": 3 },
    { "threshold": 25, "votes": 4 }
  ]
}

To achieve 1 vote per wallet, simply keep the line { "threshold": 1, "votes": 1 } under the thresholds param, and remove other keys and values.

You can test it out in the Playground on Snapshot:

You can use it with ERC-20 and ERC-721 tokens.

erc20-with-balance in its simplest form assigns 1 vote to wallets holding any balance of the token. Regardless of how big the balance is, the VP is always the same and is at 1 VP. If the wallet doesn't hold any token, the VP is 0.

This allows you to poll your community without referencing the number of tokens or NFTs they hold, each address will have 1VP.

Now, to use this strategy to set a voting threshold you can add an optional parameter minBalance and define the minimum required balance which will give the user the eligibility to vote and 1 Voting Power. The parameter value is set to 0 by default.

Strategy setup:

{
  "address": "0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419",
  "symbol": "Rome",
  "decimals": 18,
  "minBalance": 10
}

You can test it out in the Playground on Snapshot:

You can use the math strategy flexibly with various tokens and networks. This example demonstrates how to set a threshold taking into account tokens on different chains.

Math strategy is powerful in its composability. It allows you to apply common mathematical operations to the outputs of Voting Strategies.

As an example, you can take a square root of the Voting Power calculated by erc20-balance-of, or the lower (min) value out of two different Voting Strategies. You can see all possibilities on the strategy page.

How to set it up for a multichain scenario?

If the Voting Power calculated for your space is based on tokens on different chains and you want to set a minimum threshold defining if a user is eligible to vote, you can use the a-if-lt-b operand. Don't worry if it sounds cryptic, we will go through it step by step.

OperationOperand countDescription

a-if-lt-b

3

(x, a, b) = x < b ? a : x

Let's look at the formula first: (x, a, b) = x < b ? a : x, where:

  • x - sum of Voting Power calculated by the two Voting Strategies on chains 137 and 1 (as per the example below)

  • a - first constant, in our case it's 0

  • b - first constant, in our case it's 100

Strategy setup:

{
  "symbol": "GHST",
  "operands": [
    {
      "type": "strategy",
      "strategy": {
        "name": "multichain",
        "params": {
          "strategies": [
            {
              "name": "erc20-balance-of",
              "network": "137",
              "params": {
                "address": "0x385eeac5cb85a38a9a07a70c73e0a3271cfb54a7",
                "decimals": 18
              }
            },
            {
              "name": "erc20-balance-of",
              "network": "1",
              "params": {
                "address": "0x3f382dbd960e3a9bbceae22651e88158d2791550",
                "decimals": 18
              }
            }
          ]
        }
      }
    },
    {
      "type": "constant",
      "value": 0
    },
    {
      "type": "constant",
      "value": 1
    }
  ],
  "operation": "a-if-lt-b"
}

The algorithm will check if x is smaller than b, the second constant:

  • if it's below b, the final Voting Power will be set to a, first constant -> 0

  • if it's equal to and higher than b, the final Voting Power will be set to x, the sum of result from the Voting Strategies

As you can see we can easily define what is the minimum Voting Power (our example: 100) coming from different chains that is required for the user to vote!

You can test it out in the Playground on Snapshot:

You can use it with ERC-20 and ERC-721 tokens, on multiple networks.

If you want to require users to hold specific tokens in order to be eligible to vote you can use the holds-tokens strategy.

The minimum balance for each token can be customized.

Users who meet the criteria will receive 1 Voting Power regardless of the total value of the tokens they hold.

Note, that the minBalance parameter is exclusive. It means that when set to 1, the user has to hold more than 1 of the specified token in order to vote.

Strategy setup:

{
  "symbol": "XYZ",
  "tokenAddresses": [
    {
      "address": "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
      "network": "1",
      "decimals": 0,
      "minBalance": 0
    },
    {
      "address": "0xaC4255eC6885E50352A1957062ac418c2CC94e27",
      "network": "137",
      "decimals": 0,
      "minBalance": 0
    }
  ]
}

You can test it out in the Playground on Snapshot:

Last updated