Subgraphs
Schema
Our subgraph schema is composed of the following entities:
- DAOs
- Proposals
- Votes
- Members
- Rage Quits
- Shamans
- Records
- Vaults
- Event Transactions
Explorers and API Endpoints*
*
Some URLs require an api-key
in the path
Mainnet
- DAOhaus v2 Graph Explorer (opens in a new tab)
- API:
https://gateway.thegraph.com/api/[api-key]/subgraphs/id/GfHFdFmiSwW1PKtnDhhcxhArwtTjVuMnXxQ5XcETF1bP
Goerli
- DAOhaus v3 Goerli Subgraph (opens in a new tab)
- API: https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-goerli (opens in a new tab)
Gnosis Chain
- DAOhaus v3 Gnosis Graph Explorer (opens in a new tab)
- API:
https://gateway.thegraph.com/api/[api-key]/subgraphs/id/5oXHJGgAWTSEXHK5FGf7mcxYtk6rSz7MJV5ccvGfoW6q
Polygon
- DAOhaus v3 Polygon Subgraph (opens in a new tab)
- API: https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-polygon (opens in a new tab)
Arbitrum
- DAOhaus v3 Arbitrum Subgraph (opens in a new tab)
- API: https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-arbitrum (opens in a new tab)
Optimism
- DAOhaus v3 Optimism Subgraph (opens in a new tab)
- API: https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-optimism (opens in a new tab)
Example Queries
DAO
Get a specific DAO with it's profile record
{
dao(id: "0x0daoaddress") {
id
createdAt
profile: records(
first: 1
orderBy: createdAt
orderDirection: desc
where: { table: "daoProfile" }
) {
createdAt
createdBy
contentType
content
}
}
}
Get a list of DAOs
{
daos(first: 5, orderBy: createdAt, orderDirection: desc) {
id
createdAt
}
}
Members
Get a list of members for a DAO
{
members(where: { dao: "0x0daoaddress" }) {
id
createdAt
}
}
Proposals
Get a list of proposals with it's votes for a DAO
{
proposals(where: { dao: "0x0daoaddress" }) {
id
yesVotes
noVotes
yesBalance
noBalance
createdAt
votes {
id
balance
}
}
}