Skip to content

Commit 95fb677

Browse files
Updating "Migrating an Existing Subgraph to The Graph Network" page (graphprotocol#37)
* Updating "Migrating an Existing Subgraph to The Graph Network" page * Minor * Edits * Minor * Edits
1 parent 082bb20 commit 95fb677

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

pages/en/hosted-service/migrating-subgraph.mdx

+25-13
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ title: Migrating an Existing Subgraph to The Graph Network
44

55
## Introduction
66

7-
This is a guide for the migration of subgraphs from the Hosted Service (also known as the Hosted Service) to The Graph Network. The migration to The Graph Network has been successful for projects like Opyn, UMA, mStable, Audius, PoolTogether, Livepeer, RAI, Enzyme, DODO, Opyn, Pickle, and BadgerDAO all of which are relying on data served by Indexers on the network. There are now over 200 subgraphs live on The Graph Network, generating query fees and actively indexing web3 data.
7+
This is a guide on how to migrate your subgraph from the Hosted Service to The Graph Network. The migration to The Graph Network has been successful for projects like Opyn, UMA, mStable, Audius, PoolTogether, Livepeer, RAI, Enzyme, DODO, Opyn, Pickle, and BadgerDAO all of which are relying on data served by Indexers on the network. There are now over 200 subgraphs live on The Graph Network, generating query fees and actively indexing web3 data.
88

9-
This will tell you everything you need to know about how to migrate to the decentralized network and manage your subgraphs moving forward. The process is quick and your subgraphs will forever benefit from the reliability and performance that you can only get on The Graph Network.
9+
The process of migration is quick and your subgraphs will forever benefit from the reliability and performance that you can only get on The Graph Network.
1010

11-
### Migrating An Existing Subgraph to The Graph Network
11+
### When not to Migrate?
12+
13+
If your subgraph is:
14+
15+
- Indexing [IPFS](https://ipfs.io/).
16+
- Using [full-text search fields](https://thegraph.com/docs/en/developer/create-subgraph-hosted/#defining-fulltext-search-fields).
17+
- Indexing chains other than Ethereum mainnet.
18+
19+
### Migrating an Existing Subgraph to The Graph Network
1220

1321
1. Get the latest version of the graph-cli installed:
1422

@@ -64,6 +72,8 @@ graph codegen && graph build
6472

6573
And that's it! After you are done publishing, you'll be able to view your subgraphs live on the network via [The Graph Explorer](https://thegraph.com/explorer).
6674

75+
Feel free to leverage the [#Curators channel](https://discord.gg/rC8rBuRtbH) on Discord to let Curators know that your subgraph is ready to be signaled. It would also be helpful if you share your expected query volume with them. Therefore, they can estimate how much GRT they should signal on your subgraph.
76+
6777
### Upgrading a Subgraph on the Network
6878

6979
If you would like to upgrade an existing subgraph on the network, you can do this by deploying a new version of your subgraph to the Subgraph Studio using the Graph CLI.
@@ -82,34 +92,36 @@ graph deploy --studio <SUBGRAPH_SLUG>
8292

8393
An upgrade requires GRT to be migrated from the old version of the subgraph to the new version. This means that for every upgrade, a new bonding curve will be created (more on bonding curves [here](/curating#bonding-curve-101)).
8494

85-
The new bonding curve charges the 2.5% curation tax on all GRT being migrated to the new version. The owner must pay 50% of this, or 1.25%. The other 1.25% is absorbed by all the curators as a fee. This incentive design is in place to prevent an owner of a subgraph from being able to drain all their curator's funds with recursive upgrade calls. The example below is only the case if your subgraph is being actively curated on. If there is no curation activity, you will have to pay a minimum of 100 GRT in order to signal yourself on your own subgraph.
95+
The new bonding curve charges the 2.5% curation tax on all GRT being migrated to the new version. The owner must pay 50% of this, or 1.25%. The other 1.25% is absorbed by all the curators as a fee. This incentive design is in place to prevent an owner of a subgraph from being able to drain all their curator's funds with recursive upgrade calls. If there is no curation activity, you will have to pay a minimum of 100 GRT in order to signal your own subgraph.
96+
97+
Let's make an example, this is only the case if your subgraph is being actively curated on:
8698

8799
- 100,000 GRT is signaled using auto-migrate on v1 of a subgraph
88100
- Owner upgrades to v2. 100,000 GRT is migrated to a new bonding curve, where 97,500 GRT get put into the new curve and 2,500 GRT is burned
89-
- The owner then has 1250 GRT burned to pay for half the fee. The owner must have this in their wallet before the upgrade, otherwise the upgrade will not succeed. This happens in the same transaction as the upgrade.
101+
- The owner then has 1250 GRT burned to pay for half the fee. The owner must have this in their wallet before the upgrade, otherwise, the upgrade will not succeed. This happens in the same transaction as the upgrade.
90102

91103
_While this mechanism is currently live on the network, the community is currently discussing ways to reduce the cost of upgrades for subgraph developers._
92104

93105
### Maintaining a Stable Version of a Subgraph
94106

95-
If you're making a lot of changes to your subgraph, it is not a good idea to continually upgrade it and front the upgrade costs. Maintaining a stable and consistent version of your subgraph is critical, not only from the cost perspective, but also so that Indexers can feel confident in their syncing times. Indexers should be flagged when you plan for an upgrade so that Indexer syncing times do not get impacted. Feel free to leverage the [#Indexers channel](https://discord.gg/8tgJ7rKW) on Discord to let Indexers know when you're versioning your subgraphs.
107+
If you're making a lot of changes to your subgraph, it is not a good idea to continually upgrade it and front the upgrade costs. Maintaining a stable and consistent version of your subgraph is critical, not only from the cost perspective, but also so that Indexers can feel confident in their syncing times. Indexers should be flagged when you plan for an upgrade so that Indexer syncing times do not get impacted. Feel free to leverage the [#Indexers channel](https://discord.gg/rC8rBuRtbH) on Discord to let Indexers know when you're versioning your subgraphs.
96108

97-
Subgraphs are open API that external developers are leveraging. Open APIs need to follow strict standards so that they do not break external developers' applications. In The Graph Network, a subgraph developer must consider Indexers and how long it takes them to sync a new subgraph **as well as** other developers who are using their subgraphs.
109+
Subgraphs are open APIs that external developers are leveraging. Open APIs need to follow strict standards so that they do not break external developers' applications. In The Graph Network, a subgraph developer must consider Indexers and how long it takes them to sync a new subgraph **as well as** other developers who are using their subgraphs.
98110

99111
### Updating the Metadata of a Subgraph
100112

101113
You can update the metadata of your subgraphs without having to publish a new version. The metadata includes the subgraph name, image, description, website URL, source code URL, and categories. Developers can do this by updating their subgraph details in the Subgraph Studio where you can edit all applicable fields.
102114

103-
Make sure **Update Subgraph Details in Explorer** is checked and click on **Save**. If this is checked, an an on-chain transaction will be generated that updates subgraph details in the Explorer without having to publish a new version with a new deployment.
115+
Make sure **Update Subgraph Details in Explorer** is checked and click on **Save**. If this is checked, an on-chain transaction will be generated that updates subgraph details in the Explorer without having to publish a new version with a new deployment.
104116

105117
## Best Practices for Deploying a Subgraph to The Graph Network
106118

107-
1. Leveraging an ENS name for Subgraph Development
119+
1. Leveraging an ENS name for Subgraph Development:
108120

109121
- Set up your ENS: [https://app.ens.domains/](https://app.ens.domains/)
110122
- Add your ENS name to your settings [here](https://thegraph.com/explorer/settings?view=display-name).
111123

112-
The more filled out your profiles are, the better the chances for your subgraphs to be indexed and curated.
124+
2. The more filled out your profiles are, the better the chances for your subgraphs to be indexed and curated.
113125

114126
## Deprecating a Subgraph on The Graph Network
115127

@@ -123,11 +135,11 @@ In order for The Graph Network to truly be decentralized, query fees have to be
123135

124136
### Estimate Query Fees on the Network
125137

126-
While this is not a live feature in the product UI, you can set your maximum budget per query by taking the amount you're willing to pay per month and divide it by your expected query volume.
138+
While this is not a live feature in the product UI, you can set your maximum budget per query by taking the amount you're willing to pay per month and dividing it by your expected query volume.
127139

128-
While you get to decide on your query budget, there is no guarantee that an Indexer will be willing to serve queries at that price. If a Gateway can match you to an Indexer willing to serve a query at, or lower than, the price you are willing to pay, you will pay the delta/difference of your budget **and** their price. As a consequence of that, a lower query price reduces the pool of Indexers available to you, which may affect the quality of service you receive. It's beneficial to have high query fees, as that may attract curation and big name Indexers to your subgraph.
140+
While you get to decide on your query budget, there is no guarantee that an Indexer will be willing to serve queries at that price. If a Gateway can match you to an Indexer willing to serve a query at, or lower than, the price you are willing to pay, you will pay the delta/difference of your budget **and** their price. As a consequence, a lower query price reduces the pool of Indexers available to you, which may affect the quality of service you receive. It's beneficial to have high query fees, as that may attract curation and big-name Indexers to your subgraph.
129141

130-
Remember that it's a dynamic and growing market, but how you interact with it is in your control. There is no maximum or minimum price specified in the protocol or in the Gateways. For example, you can look at the price paid by a few of the dapps on the network (on a per week basis), below. See the last column which shows query fees in GRT. For example, [Pickle Finance](https://www.pickle.finance/) has 8 requests per second and paid 2.4 GRT for one week.
142+
Remember that it's a dynamic and growing market, but how you interact with it is in your control. There is no maximum or minimum price specified in the protocol or the Gateways. For example, you can look at the price paid by a few of the dapps on the network (on a per-week basis), below. See the last column, which shows query fees in GRT. For example, [Pickle Finance](https://www.pickle.finance/) has 8 requests per second and paid 2.4 GRT for one week.
131143

132144
![QueryFee](/img/QueryFee.png)
133145

0 commit comments

Comments
 (0)