Subgraph Showroom

Overview

I went ahead and coded up a prototype based on the ideas discussed in this thread. In particular, I sketched out what a bonding curve would look like with:

  • An initialization phase during which anyone can enter and exit the curve at a uniform price.
  • An initialization exit phase during which the bonding curve reserve changes linearly from 1 (a flat curve) to its target reserve ratio, currently set in the protocol at 1/2.

Rationale

The primary rationale for this design, as articulated above, is to provide honest Curators ample time to evaluate a subgraph by removing the overwhelming incentive to be first into the curve when a subgraph is deployed, as exists in the protocol today.

A secondary benefit of this design, not discussed yet, is to lay the ground work for better N-1 support for subgraph developers. Currently, there is a strong incentive for a subgraph developer to migrate all their signal from a previous subgraph version to a new version in one go, so as to avoid being front-run on their own subgraph. The Graph Name Service (GNS) actually enforces such a one-step signal migration.

This is bad for subgraph developers, because the previous version may stop being indexed by Indexers as soon as it is unsignaled, but the new version may not have had time to sync w/ Indexers after deployment. If new subgraph deployments kept a flat curve for a longer period of time, then subgraph developers could incrementally migrate signal from a previous version to a new version, ensuring better continuity of Indexer availability during the upgrade, without getting front-run on their own subgraphs.

Protoype Walkthrough

Because the notebook is large (and only lightly commented), I recorded these quick loom videos:

  • Notebook Overview - Provides an overview of the structure of the notebook and how to run simulations.
  • Initialization Phase Prototype - Goes into the specifics of how the initialization phase prototype is set up and the scenario in the notebook that highlights the capabilities of the mechanism.

I highly encourage you to fork the notebook and add your own scenarios or present the data from the simulations in more approachable ways.

Open Questions

This design introduces some additional questions:

  • What is the ideal initialization phase duration?
  • Should we also introduce initialization phases at the GNS level or only the base protocol layer? (Recall that curation in The Graph today uses nested bonding curves)

Next Steps

Here are some suggested next steps for this proposal:

  • @ari has agreed to use the prototypes as a starting point for evaluating gas costs and feasibility of implementation on L1.
  • Describe this idea more formally in a GIP.

Asks

I’m going to be traveling starting next Wednesday, and may not have time to put together a more formal GIP before I’m offline. Given that this is an idea that came from the community, would be great if someone from the community felt compelled to write the GIP. Folks at The Foundation and other core devs can provide input on how to put together a good GIP.

13 Likes