Subgraph curating: a product market fit hands-on guide.

Jarbas Silva
5 min readNov 19, 2020

--

Choosing a subgraph

The Graph Protocol is an open-source project that aims to index Ethereum on-chain data making it easily accessible for anyone to query, build, and publish open APIs, called subgraphs. Imagine that developers of Web3 applications can focus exclusively on the front-end and business rules of their dApps, letting the back-end on behalf of the protocol foundation built by The Graph, and running by Indexers, Curators, Delegators, and Developers, resulting in a brand new open data marketplace. This is what the crypto market is waiting for the next 60 days on The Graph mainnet launch.

Meanwhile, on The Graph testnet, the Curators Program is on Phase 2 which is about evaluating subgraphs on the completeness, accuracy, and complexity criteria in order to assure that they are capable of supporting an application’s data needs. The process of evaluating a subgraph up to now is an open experience that the curator's group is elaborating in a crowdsourcing model. At this moment, there is no step by step defined that could help new curators and The Graph community as a whole in this fundamental task. In this article, I will describe my exploratory approach to accomplish this goal.

I chose the Protofire Maker-Dao subgraph for this exercise due to its comprehensiveness making it possible to didactically pass through all the aspects I considered important in this analysis. Let’s begin to describe what the subgraph does: the protofire/maker-dao subgraph indexes all information (vaults, collateral types, collateral prices, users, auctions, etc) about Maker DAO protocol that manages the generation of a decentralized stable coin called DAI, backed by some types of Ethereum-based tokens as collaterals.

Is it production ready?

The next step is to understand the status of the subgraph. Does this subgraph look production-ready? In order to answer this question there are some clues to follow:

  1. Look at the SYNCED status and the number of entities of the subgraph at the playground on (https://thegraph.com/explorer/).
https://thegraph.com/explorer/subgraph/protofire/makerdao-governance

2. Still on the playground, run a query to verify if the subgraph is working fine.

Maker DAO subgraph query result

3. On the subgraph, there is a Manifest file, which is a set of instructions on how to build the subgraph and is called subgraph.yaml. You need to verify which network is in use (check for mainnet) and if the contract address is the production one — for the second task you can check the contract on etherscan.

Manifest file: subgraph.yaml
Contract Address 0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B on etherscan

4. Evaluating the schema will give us a clue if the main aspects of the protocol are represented and consumers of the subgraph will have their data needs satisfied. But how do you know about the details of the schema? The answer is looking at the protocol documentation that the subgraph is about and compare if the schema keeps a strong correspondence with it. In this case, I also had to read the documentation in order to understand the basics of how the Maker DAO protocol works.

5. Check the level of documentation of the subgraph code. You can see in the picture above that it’s easier for the reader to understand absolutely everything in the Protofire Maker DAO subgraph.

6. Another complimentary info that you can verify is the number of contributors in the GitHub repository. The idea is to check if there is a team supporting the subgraph.

GitHub repository: https://github.com/protofire/maker-governance-subgraph

Subgraph market fit

Does this subgraph look like it would be useful to others? Answering this question is like to assess if there is a market for a product. I create a hypothesis that as much as comprehensive and complete the subgraph is much is possible to be used by Web3 applications. This is because the subgraph can have a general use as were a database of many different applications. According to this approach, the Protofire Maker DAO subgraph is useful to others since it has a very complete schema that represents most of the aspects of the protocol.

What changes would you make to the schema including additions or modifications to entities, fields, field types, relationships, or any other improvements? Definitely, this subgraph is a challenge to find room for improvements due to its completeness. Anyway, I think it would be helpful to have aggregated data, for example, hourly and daily transactions/volumes for DAI (mint/burn) and the same for each collateral.

The last task of the subgraph analysis is to identify the degree of completeness, complexity and accuracy of the implementation. The Protofire Maker DAO subgraph is very complete and well documented, showing the main aspects of the protocol — Degree of completeness: High. It misses an analytics approach that could improve the use due to the importance of analytical data has in most of the Web3 dApps. In my analysis, it took some time to understand the protocol concepts but it’s not a top complexity subgraph — Degree of complexity: Medium. Comparing the schema entities with the protocol documentation it’s clear the mapping was very well done — Degree of accuracy: High.

Conclusion

There is a great variety of subgraphs on top of The Graph Protocol supporting most of the valuable dApps on Ethereum ecosystem like Uniswap V2, Compound V2 and Synthetix. Understanding how to curate these subgraphs is an important role in the protocol adoption in order to drive traffic for existent applications and make it possible for new ones to have access to on-chain data unavailable before. In this post I describe my exploratory approach to curate a subgraph and realized that this task is very like evaluate a product market fit.

Thanks for reading!

Resources

If you’re interested in learning more about The Graph, check out these resources:

--

--

Jarbas Silva

A technologist interested in science, research & development