{"id":19607101,"url":"https://github.com/jbx-protocol/juice-subgraph","last_synced_at":"2025-06-19T08:37:34.684Z","repository":{"id":37956794,"uuid":"408941818","full_name":"jbx-protocol/juice-subgraph","owner":"jbx-protocol","description":"📊 Juicebox Subgraph implementation.","archived":false,"fork":false,"pushed_at":"2025-01-13T21:31:24.000Z","size":738,"stargazers_count":12,"open_issues_count":6,"forks_count":18,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-27T19:46:17.553Z","etag":null,"topics":["ethereum","juicebox","subgraph"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbx-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-21T19:02:34.000Z","updated_at":"2025-01-13T21:31:28.000Z","dependencies_parsed_at":"2023-01-29T20:15:17.641Z","dependency_job_id":"c6298e55-19e5-4e71-bb01-8424314962de","html_url":"https://github.com/jbx-protocol/juice-subgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jbx-protocol/juice-subgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-subgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-subgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-subgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-subgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbx-protocol","download_url":"https://codeload.github.com/jbx-protocol/juice-subgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbx-protocol%2Fjuice-subgraph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260717500,"owners_count":23051665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","juicebox","subgraph"],"created_at":"2024-11-11T10:08:54.423Z","updated_at":"2025-06-19T08:37:29.662Z","avatar_url":"https://github.com/jbx-protocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Juicebox Subgraph\n\n## Overview\n\nMultiple subgraphs are maintained by [Peel](https://discord.gg/b4rpjgGPHX) in a Graph Studio owned by the [Peel Gnosis safe](https://gnosis-safe.io/app/eth:0x0e9D15e28e3De9bB3CF64FFbC2f2F49Da9Ac545B).\n\nJuicebox mainnet subgraph is published here: https://thegraph.com/explorer/subgraph?id=FVmuv3TndQDNd2BWARV8Y27yuKKukryKXPzvAS5E7htC\u0026view=Overview\n\nContract addresses and startBlocks are defined in `config/\u003cnetwork\u003e.json`\n\nSubgraph data sources (contract definitions and event handlers) are defined in `subgraph.template.yaml`\n\n_`subgraph.yaml` is gitignored and should not be edited._\n\n## Getting started\n\n```bash\nyarn install\n\nyarn global add @graphprotocol/graph-cli\n```\n\n## Config\n\n`config/*.json` files define addresses and start blocks for contracts on specific networks. Usually, a contract's start block should be the block where that contract was deployed.\n\n## Generating subgraph.yaml\n\nSubgraphs are defined by a `subgraph.yaml` file, which is generated from `*.template.yaml` files. To make it easier to support multiple contract versions, there is a template file for each version as well as \"shared\".\n\nRunning `yarn prep \u003cnetwork\u003e` will run `scripts/prepare.js` to construct a `subgraph.yaml` file for that network, using yaml template files and the contracts defined in `config/\u003cnetwork\u003e.json`.\n\nThe `prepare.js` script also performs a safety check for mismatches between the generated `subgraph.yaml` and the mapping files. Warnings will be shown if:\n\n- a function is referenced in the `subgraph.yaml` that isn't defined in any mapping files\n- a function defined in a mapping file isn't referenced in the `subgraph.yaml`\n\n## Grafting\n\n[Grafting](https://thegraph.com/docs/en/developing/creating-a-subgraph/#grafting-onto-existing-subgraphs) allows a new subgraph to use data from a pre-indexed subgraph version up to a specific block height, requiring less time for the new subgraph to index.\n\nA grafting configuration can be optionally defined in `config/graft.json`, like:\n\n```\n{\n  \"base\": \"\u003csubgraph-id\u003e\", # Qm...\n  \"startBlock\": \u003cblock-number\u003e, # 123...\n  \"skip\" \u003cboolean\u003e # ignore grafting config if true\n},\n```\n\nSee `config/graft.example.json` as an example.\n\n\u003e Note: Grafting is only supported on the hosted service and cannot be used in a subgraph deployed on the decentralized network\n\n## Deploying\n\nTo deploy a new subgraph version, first prepare the subgraph for the intended network. This will:\n\n- Run a sanity check beyond the integrated graph-cli checks that ensures there are no missing or extra mapping functions or dataSources\n- Generate files with network-dependent variables `src/startBlocks.ts` and `src/contractAddresses.ts`\n- Generate schema types\n- Generate the subgraph.yaml\n\n```bash\nyarn prep:goerli\nyarn prep:sepolia\nyarn prep:mainnet\n```\n\n- Generates TS types for the schema defined in `schema.graphql`\n- Compiles new gitignored `subgraph.yaml`\n\nFirst you will need to authenticate with the proper deploy key for the given network (you'll only need to do this once).\n\n```bash\ngraph auth --studio ${your-key}\n```\n\nOnce authenticated:\n\n```bash\ngraph deploy --studio \u003csubgraph-name\u003e\n```\n\n\u003e Note: previous subgraph versions will be automatically archived when new versions are deployed, and must be manually unarchived if needed.\n\nTo check health of a deployed subgraph:\n\n```\ncurl -X POST -d '{ \"query\": \"{indexingStatuses(subgraphs: [\\\"\u003cdeployment-id\u003e\\\"]) {synced health fatalError {message block { number } handler } subgraph chains { chainHeadBlock { number } latestBlock { number }}}}\"}' https://api.thegraph.com/index-node/graphql\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbx-protocol%2Fjuice-subgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbx-protocol%2Fjuice-subgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbx-protocol%2Fjuice-subgraph/lists"}