Skip to content
 
 

Repository files navigation

Uniswap V3 and V3-Tokens Subgraph

Development

  1. Install dependencies yarn install

  2. Build a v3 subgraph yarn build --network <network> --subgraph-type v3

  3. Deploy a v3 subgraph yarn build --network <network> --subgraph-type v3 --deploy

  4. Build a v3-tokens subgraph yarn build --network <network> --subgraph-type v3-tokens

  5. Deploy a v3-tokens subgraph yarn build --network <network> --subgraph-type v3-tokens --deploy

Note: Deployments will fail if there are uncommitted changes in the subgraph. Please commit your changes before deploying.

Taiko Alethia and Taiko Hoodi Testnet via Goldsky

  1. Install dependencies yarn install

  2. Codegen types yarn build --network <taiko/taiko-hoodi-testnet> --subgraph-type <v3/v3-tokens>

  3. Build graph Note that once codgen aka yarn build you can create the build any graph with this command. yarn build:graph:<v3/v3-tokens>

  4. Deploy to Goldsky yarn deploy:<v3/v3-tokens>:<taiko/taiko-hoodi-testnet>:goldsky

Each deploy publishes a new version named after the current commit (git rev-parse --short HEAD), e.g. uniswap-v3-taiko/f4eb0c8. The previously deployed version keeps serving and is not touched.

Stable endpoints via release tags

Version-specific URLs change on every deploy, which means every consumer has to be updated by hand. A Goldsky tag is a stable alias that points at one version, so consumers pin the tag and a release becomes a pointer move instead of a frontend change.

Each network has its own tag: mainnet for Taiko Alethia, testnet for Taiko Hoodi. Tagged endpoints replace the version with the tag name:

https://api.goldsky.com/api/public/<project>/subgraphs/uniswap-v3-taiko/mainnet/gn
https://api.goldsky.com/api/public/<project>/subgraphs/uniswap-v3-taiko-hoodi-testnet/testnet/gn
  1. Tag a deployment yarn tag:<v3/v3-tokens>:<taiko/taiko-hoodi-testnet>:goldsky

The script picks the right tag for the network, so there is no way to accidentally alias a Hoodi deployment as mainnet.

The tag scripts resolve the version from the current commit, exactly like the deploy scripts, so check out the commit you deployed before tagging.

Before moving a tag the script queries Goldsky and refuses to continue unless the deployment exists, reports healthy, and is 100% synced. This matters because goldsky subgraph list exits 0 even for a version that was never deployed, so an unguarded tag command fails silently.

Adding or moving a data source start block forces a full reindex, so a fresh deploy can take hours to reach 100% on Taiko Alethia. Deploy first, let it backfill, then move the tag.

About

Subgraph for Uniswap V3

Resources

Code of conduct

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages