Skip to content

pinax-network/subgraph-cosmos-proposals

Repository files navigation

Subgraph: Cosmos Governance Proposals

Tracks governance proposals on Cosmos based networks.

Data Includes

  • Votes
  • Deposits
  • GovernanceParameter
  • Proposals
    • SoftwareUpgrade
    • ParameterChange
    • CommunityPoolSpend
    • ClientUpdate

Chains

Chain Subgraph ID
Injective SUBGRAPH_ID
CosmosHub SUBGRAPH_ID
Osmosis SUBGRAPH_ID

Proposals explorers

Concepts

https://docs.cosmos.network/v0.46/modules/gov/

The governance process is divided in a few steps that are outlined below:

  • Proposal submission: Proposal is submitted to the blockchain with a deposit.
  • Vote: Once deposit reaches a certain value (MinDeposit), proposal is confirmed and vote opens. Bonded Atom holders can then send TxGovVote transactions to vote on the proposal.
  • Execution: After a period of time, the votes are tallied and depending on the result, the messages in the proposal will be executed.

GraphQL

SoftwareUpgradeProposals

query SoftwareUpgradeProposals{
  softwareUpgradeProposals(orderBy:planHeight) {
    id
    planName
    planInfo
    planHeight
    proposal{
      id
      proposer
      transaction {
        id
      }
    }
  }
}

Proposals

query Proposals{
  proposals(orderBy:block__number) {
    id
    block{
      number
      date
    }
    proposer
    title
    summary,
  }
}

Deposits grouped by Proposals

query DepositsGroupedByProposals {
  proposals(orderBy:block__number) {
    id
    title
    deposits{
      depositor
      denom
      amount
      block{
        number
        date
      }
    }
  }
}