> For the complete documentation index, see [llms.txt](https://celopg.gitbook.io/tokenmanager/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://celopg.gitbook.io/tokenmanager/infrastructure/subgraph.md).

# Subgraph

Two subgraphs index the token factories, generated from one Mustache template (`subgraph.template.yaml`) per [The Graph's multi-network best practices](https://thegraph.com/docs/en/subgraphs/developing/deploying/multiple-networks/).

| Name              | Network          | Contract                 |
| ----------------- | ---------------- | ------------------------ |
| `minter-ethereum` | Ethereum Mainnet | L1TokenFactory           |
| `minter-celo`     | Celo Mainnet     | L2SuperChainTokenFactory |

## Setup & deploy

1. Create both subgraphs (slugs above) in [The Graph Studio](https://thegraph.com/studio/) and grab your Deploy Key.

```bash
npm install
npm run auth              # enter Deploy Key

npm run build:ethereum    # template → codegen → build
npm run build:celo

npm run deploy:ethereum   # prompts for a semver version, e.g. 0.0.1
npm run deploy:celo
```

{% hint style="info" %}
`subgraph.yaml` is auto-generated from the template — don't commit it.
{% endhint %}

## Example query

```graphql
{
  tokens(first: 10) {
    id tokenAddress name symbol creator createdAt
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://celopg.gitbook.io/tokenmanager/infrastructure/subgraph.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
