Package Logo
uniswap-governance
uniswap-governance@v0.1.0
Total Downloads
37
Published
1 weeks ago
Publisher
User Avatar Aaditya-G

Readme

Uniswap Governance Substream

A high-performance, production-ready Substream for indexing Uniswap Governance proposals and votes on the Ethereum Mainnet.

This module provides a clean, reliable data feed that can be used to power a Subgraph or any other data sink, providing a significant speed advantage over traditional indexing methods.

Features

  • Tracks ProposalCreated events: Captures proposal ID, proposer, description, and creation time.
  • Tracks VoteCast events: Captures voter, weight, choice (For, Against, Abstain), and the vote reason.
  • Outputs EntityChanges: Ready to be consumed directly by a Substream-powered subgraph.

Quickstart: Using This Substream

To use this Substream as a module in your own project (e.g., to power a subgraph), add the following to your substreams.yaml manifest:

imports:
  uniswap_governance: https://spkg.io/your-username/your-substream-name-v0.1.0.spkg

modules:
  - name: my_downstream_module
    kind: map
    inputs:
      - map: uniswap_governance:graph_out
    output:
      # ... your logic here

The primary output module is graph_out, which emits sf.substreams.entity.v1.EntityChanges.

Development & Setup

Prerequisites

Commands

  1. Build the Wasm Module:

    cargo build --release --target wasm32-unknown-unknown
    
  2. Package the Substream:

    substreams pack
    
  3. Test the Output (Optional):

    substreams run -e mainnet.eth.streamingfast.io:443 substreams.yaml graph_out --start-block 13059157 --stop-block +1000
    

Documentation

Modules

Maps icon
Maps

map
map_proposals

b04eb1c16fc07082d0053306dcdca60a44fcddfd
map map_proposals (
blocksf.ethereum.type.v2.Block
)  -> uniswap.Proposals
substreams gui uniswap-governance@v0.1.0 map_proposals

map
map_votes

e4a9a8a9fa4e5f4589e9749c70d7fb0af17e7614
map map_votes (
)  -> uniswap.Votes
substreams gui uniswap-governance@v0.1.0 map_votes

map
graph_out

cc9944a5db4f052972622197e8ff0ed01b986ec2
substreams gui uniswap-governance@v0.1.0 graph_out
Protobuf

Protobuf Docs Explorer

uniswap