Figure out how to See Votes at a Certain Time in Snapshot
Introduction
- It would be good to implement a system of where people can vote on topics, priorities or other kinds of polls and be able to see the amount of votes for the different polls and options at a set time without needing to set a poll to end at that time
- This would allow us to have ongoing polls in subspaces where we can vote on topics, priorities or other kinds of polls throughout the season without needing to end the poll at a certain time and recreate the same poll again later
Table of Contents
- Figure out how to See Votes at a Certain Time in Snapshot
- Introduction
- More Detailed Rationale
- Current Status
- How can you see past 'blocks' in snapshot? For example, how can you see the Snapshot votes at a certain time ?
- Technical Implementation
- How to See Past Votes in Snapshot:
- Example of Using Snapshot GraphQL API:
- Example via The Graph Subgraph:
- Further Documentation:
- Rationale
More Detailed Rationale
Current Status
- It seems possible to see exactly how many votes a poll or option received at a certain time using the Snapshot API or The Graph. For example, we could see the amount of votes for all polls and options at 17 UTC on Monday.
- However, this appears to require some programming and does not seem possible to do without additional technical work.
- So for the beginning of Season 3 we should play a form of Cagendas where topic creators need to create a topic each week.
- This is a less ideal solution than allowing topics to be proposed once a season without needing to re-propose them each week, but it is simpler to implement technically.
- With this setup, as host @Dan Singjoy will make sure to prepare some topic proposals each week in advance by Friday so that we have interesting topics to vote on
- Of course everyone else is welcome and encouraged to make topic proposals as well. Feel free to propose whatever topics interest you!
- We should work towards developing the solution with the API or The Graph to make it possible to keep topics up throughout the season
- The section below shows the current limitations of viewing votes at a certain time on Snapshot and how a
How can you see past 'blocks' in snapshot? For example, how can you see the Snapshot votes at a certain time ?
In Snapshot, each proposal captures a "snapshot" of the voting power at a specific block number when the proposal is created. This block number represents a point in time on the blockchain, and the voting power of each participant is determined based on their token holdings at that time. If you want to see the votes at a certain time, you would need to look at the proposals that were active or created around that time and examine the snapshot block number associated with those proposals.
Snapshot does not directly offer historical browsing by block number or timestamp in a user-friendly way through their web interface. However, you can view past proposals and their details, including the snapshot block number, by navigating through the proposals list in each space on Snapshot.
To view detailed historical voting data, you might need to access the underlying blockchain data directly or use blockchain explorers that can query specific block numbers to see the state of token holdings at that time. This approach requires technical knowledge about blockchain data queries and might involve using tools or APIs that interact with the Ethereum blockchain (or other supported blockchains), where the token snapshots are recorded.
For more detailed guidance on creating proposals and understanding the snapshot mechanism in Snapshot, you can refer to their official documentation: Snapshot Docs.
Technical Implementation
In Snapshot, you can see the state of votes at a particular point in time using "snapshots," which refer to the blockchain state at a specific block number. Here's how you can view past votes:
How to See Past Votes in Snapshot:
- Access the Snapshot Proposal URL: Every proposal on Snapshot has a unique URL. Visit the specific proposal's URL to access details of that vote.
- Check Snapshot Block Numbers:
- Each proposal displays a "snapshot" block number. This indicates the block at which the votes were counted.
- The snapshot block number ensures that votes are calculated based on user token balances or other criteria at that specific block number.
- Inspect Voting Details at the Snapshot Block:
- Within the proposal page, you can see the list of voters and their voting power at the snapshot block.
- The proposal page will list how each address voted and the weight of their vote.
- Use GraphQL or Snapshot API:
- Snapshot provides an API that allows you to query past proposals and voting results directly.
- Alternatively, you can use The Graph's subgraphs to query historical data using GraphQL.
Example of Using Snapshot GraphQL API:
To find past votes via the API, you can use a query like this:
graphqlCopy code
{
proposal(id: "your-proposal-id") {
id
title
choices
scores
votes {
voter
choice
vp
}
snapshot
}
}
Replace "your-proposal-id"
with the actual proposal ID you are interested in. This query will return:
- The proposal ID and title.
- Choices and their respective scores.
- Detailed voting data including voters, choices, and their voting power.
Example via The Graph Subgraph:
You can also query historical Snapshot votes using subgraphs:
graphqlCopy code
{
proposals(first: 10, where: {space: "space-id"}) {
id
title
choices
scores
votes {
voter
choice
vp
}
snapshot
}
}
Replace "space-id"
with the specific space ID to get the proposals and votes in that subspace.
Further Documentation:
- Snapshot GraphQL API
- The Graph Subgraphs
These tools should help you explore historical Snapshot votes at specific times effectively.