Yearn Governance Subgraph for Querying Data on the Front End (Created!)

Hi Folks! Dennison here! :wave:t4:

I created a Yearn Governance subgraph to help query the network regarding Yearn Governance.

You can check out the Playground at The Graph: :sparkles:
https://thegraph.com/explorer/subgraph/crazyrabbitltc/yearngovernance?version=current

You can make queries from your front end code here: :dizzy:
https://api.thegraph.com/subgraphs/name/crazyrabbitltc/yearngovernance

Example Queries:

List all Proposal:

{
proposals{
  id
  quorum
  quorumReached
  quorumRequired
  metadata
  forVotes
  againstVotes
  
}
}

To get all voters, their proposals they proposed and if they are staking (plus more:

{
voters{
  id
  proposalsProposed{
    id
  }
  ballotsCast {
    id
    support
  }
  stakedAmount
  staking
  paidReward
}
}

If you check out the playground you will see many more kinds of queries you can access via The Graph decentralized network!

11 Likes

cool! FYI playground not loading for me…

It’s loading for me now, maybe The Graph had some downtime, try now?

@dennison awesome stuff! Do you mind opensourcing the code?

Want to polish the code and migrate it to yearn repo.

3 Likes

No problem!

If you can just keep some sort of attribution to me that would be awesome.

The repo:

4 Likes

Spotted and added, well-done guys.
https://thegraph.com/explorer/subgraph/codingisfunforlife/yfi

5 Likes