Skip to content

a Python-based tool to do automated querying of snapshot.page with multiple Ethereum addesses using graphql. Creates a json file with all currently active proposal ids of joined spaces per each wallet.

License

Notifications You must be signed in to change notification settings

al-matty/web3-governance-query

Repository files navigation

Web3 Governance Query

GitHub Python 3.6+ Libraries.io dependency status for GitHub repo

A script to query snapshot.page with multiple Ethereum addresses. It returns 3 files:

  • to_vote.json for each address: all active proposal ids that the address hasn't yet voted on
  • to_vote.csv for each address: all snapshot space names with currently active proposals that the address hasn't yet voted on
  • choices.json proposal data for all active proposals, usable as voting recipe for the complementary repo snapshot-vote

The json files are meant to be used as potential input for other scripts taking automated actions based on the queried data, while the csv file is meant to be more of an easily verifiable sanity check of the script's general functionality. The script is intended to run as an automated task on a regular basis. To filter out some potential noise and avoid blacklisting targeting bots, proposals are ignored if:

  • a customizable trigger word is detected in the title
  • less than 30% of the average voters have participated (average calculated from the last 2 proposals). This is not a problem if the script is run regularly. As soon as the proposal gains some traction (>30%), it will no longer be filtered out.

Usage

Specify all the Ethereum addresses you want to get voting information on in './wallets.txt', one address per line. If you haven't joined any spaces with these wallets on snapshot.page yet, with each wallet, join each snapshot space that you want updates on in the future. This needs to be done one time only. Run snapshotQuery.py. The three mentioned output files will be created in your project folder.

Using the 'choices.json' file, you can now automate voting based on customizable conditions using the repo snapshot-vote for voting and create_choices_json() to freely customize the logic for voting.

csv example:

Preview

json example:

Preview

License

This project is licensed under the MIT license - see the LICENSE file for details.

About

a Python-based tool to do automated querying of snapshot.page with multiple Ethereum addesses using graphql. Creates a json file with all currently active proposal ids of joined spaces per each wallet.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages