Skip to content

The official subgraphs of the Enzyme protocol.

License

Notifications You must be signed in to change notification settings

enzymefinance/subgraphs

Repository files navigation

Enzyme Subgraphs

Introduction

This repository contains the various subgraphs that Enzyme Finance uses:

Installation

Before you can use the Enzyme subgraphs, make sure you have the latest versions of Node.js, pnpm installed.

Install project dependencies from the main directory:

pnpm install

Subgraph Contexts

Each subgraph can be used in different contexts, i.e. for different deployements and chains.

Default contexts are:

  • ethereum
  • polygon

Run code generators for a subgraph

In order to generate a subgraph.yaml file and AssemblyScript classes for a specific subgraph, go to the subgraph directory (in /subgraphs/name-of-subgraph) and run

pnpm codegen <context>

Build a subgraph

Code generation does not check your mapping code. If you want to check the mapping code before uploading it, run

pnpm build <context>

Deploy a subgraph

To deploy a subgraph to the default location, you need to be logged into the Graph CLI:

pnpm graph auth --studio

Once logged in, go to the subgraph directory (in /subgraphs/name-of-subgraph) and run

pnpm upload <context>

Deployed subgraphs

All subgraphs are deployed on the Graph network:

Ethereum

Polygon

Arbitrum