Cover photo

Voting in Realms: Locking Tokens and Plugin System

Voting, Locking Tokens, Vote Record and Plugin System

Voting and Locking Tokens

Voting is a fundamental aspect of the SPL Governance system that allows participants to have a say in decision-making. In this chapter, we will explore who can vote on proposals and how is the voting power calculated?

To be eligible to vote, an individual must be the owner of the relevant tokens. When a realm is created within the SPL Governance system, the community and council mints are defined. Ownership of tokens from these mints grants individuals the right to participate in the voting process.

The calculation of voting power is based on the ratio between the number of tokens a voter has locked and the maximum voter weight of tokens for the respective mint. For council tokens, the maximum voter weight is typically equivalent to the total supply of tokens for that mint. However, for community tokens, the maximum voter weight can be configured differently. The realm configuration allows for the community_mint_max_voter_weight_source attribute to be set, which can consider factors such as the total supply of tokens, an absolute number, or a fraction of the total supply (code). The plugin system can also be utilized for additional flexibility in configuring voting power (see below).

In addition to token ownership, the realm configuration also determines how tokens are treated within the governance system (code). If a token is designated as membership type, it is controlled by the realm and cannot be transferred to another wallet. On the other hand, if a token is classified as liquid type, it can be freely traded and transferred, and the authority over the mint is controlled either by the realm or by another entity. The dormant token type indicates that a portion of the voting population is disabled within the realm.

To exercise their voting power, token owners must lock their tokens to the realm. This is accomplished through a deposit call (code), which effectively locks the tokens until an active proposal, in which the voter has participated, exists. To withdraw their tokens, owners must wait until the voting period for the active proposal concludes or choose to relinquish their votes.

For each voter, the SPL Governance system creates a token owner record, associated with their wallet. This record keeps track of the number of tokens locked, the number of active proposals the voter has voted on, and the number of un-relinquished proposals. These factors determine the eligibility for withdrawal.

The voting power of a token owner is determined by the number of locked tokens recorded in their token owner record. It's important to note that an owner can delegate their voting power to another wallet by setting up the delegate field (code) in their token owner record. However, each token owner record can have only one delegate defined.

Vote record

Casting a vote means to add the voting weight to the proposal option (code). The voter can choose to vote for or against the proposal or to abstain from voting. The type of vote is defined by the Vote enum and passed as an argument in the cast vote instruction (code).

When a token owner wishes to cast their vote, they have three options: voting for the proposal, voting against it, or choosing to abstain. The type of vote is defined by the Vote enum, which is passed as an argument in the cast vote instruction.

Once a vote is cast, information about the vote is recorded in two key locations within the Solana blockchain. First, the proposal account is updated to include a summary of the voting weights for each option (code). This information is utilised during the finalisation of the proposal, although vote records themselves are not directly used for this purpose.

The second location where voting information is stored is in a vote record account. This account serves as a repository of details regarding the casted vote. It captures essential information such as the voting weight assigned to the option, the type of vote (for, against, or abstain), and other relevant data. The creation of a vote record account confirms that a vote has been cast by a specific token owner for a particular proposal. The purpose of the vote record is twofold: to prevent double voting by ensuring that a token owner can only cast one vote per proposal and to maintain a historical record of voting activities.

By storing voting information in both the proposal account and the vote record account, the SPL Governance system ensures transparency, integrity, and accountability in the voting process. This data contributes to the determination of the outcome of proposals and allows for auditing and analysis of past voting activities.

Plugin System

The SPL Governance program is built with extensibility in mind, allowing for flexibility and customisation to meet the unique needs of different DAOs. In version 3.1 of the program, there are two available extension points: the voter weight addin and the max voter weight addin. These extensions enhance the functionality of the governance system and provide additional options for calculating voting power.

When configuring a realm in the SPL Governance system, it is possible to specify an addin to be used for the calculation of the voting power, also known as the voter weight, and the maximum voter weight (code). This configuration attribute opens up many possibilities for determining voting power beyond simply relying on the number of locked tokens associated with a specific mint.

By utilising an addin, the voting power calculation can incorporate various factors or metrics that are relevant to the specific DAO's governance model. This means that the voting power can be derived from sources other than just the quantity of locked tokens.

The ability to configure addins for voter weight and max voter weight calculations empowers DAOs to design their governance systems in a way that aligns with their unique dynamics and objectives. It allows for a more nuanced and tailored approach to voting power, reflecting the intricacies of the DAO's token ecosystem, membership structure, or other relevant factors.

Learn more


This article was originally written by Chalda from Marinade (read here). ❤️

Need help or have feedback?

We've put together some documentation here, but if you still have questions you'd like answered we’d love to hear from you.

You can reach Realms team via Discord and Twitter.

Loading...
highlight
Collect this post to permanently own it.
xentoshi logo
Subscribe to xentoshi and never miss a post.
  • Loading comments...