Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mstable/mStable-subgraphs-monorepo
🌐 All mStable subgraphs in one handy monorepo.
https://github.com/mstable/mStable-subgraphs-monorepo
assemblyscript defi ethereum graphprotocol graphql subgraph
Last synced: 3 months ago
JSON representation
🌐 All mStable subgraphs in one handy monorepo.
- Host: GitHub
- URL: https://github.com/mstable/mStable-subgraphs-monorepo
- Owner: mstable
- License: mit
- Created: 2020-10-19T08:20:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-03T09:10:07.000Z (over 2 years ago)
- Last Synced: 2024-07-29T16:58:22.229Z (6 months ago)
- Topics: assemblyscript, defi, ethereum, graphprotocol, graphql, subgraph
- Language: TypeScript
- Homepage: https://mstable.org
- Size: 1.19 MB
- Stars: 16
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mStable Subgraphs
All [mStable](https://mstable.org) subgraphs in one handy repo.
## Installation
This project uses [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) and [Lerna](https://github.com/lerna/lerna).
```bash
# First enable yarn workspaces if needed
yarn config set workspaces-experimental true
# Install and link
yarn
yarn lerna bootstrap --force-local && yarn lerna link --force-local
# Prepare all the subgraphs for the first time
yarn prepare:config
```## Packages
- `@mstable/subgraph-utils`
- Schemas/entities for shared items (e.g. Metrics, Tokens)
- Utilities for interacting with data types and performing conversions
- Scripts for e.g. merging GraphQL schemas
- `@mstable/protocol-subgraph`
- Subgraph for the mStable protocol
- Encompasses mAssets, bAssets, saving contracts, and metrics
- `@mstable/governance-subgraph`
- Subgraph for mStable governance contracts
- Encompasses MTA staking, staking rewards, voting power, and metrics
- `@mstable/ecosystem-subgraph`
- Subgraph for mStable's wider ecosystem
- Encompasses EARN pools, Merkle drops, pool fund management, and metrics## Development
- GraphQL types in `packages/utils` are stitched together with `yarn codegen` (in that directory).
- These types can be consumed in other packages with import comments (e.g. `# import Token`); the schema for each subgraph is created via codegen.
- Each subgraph shares the same config (for different networks) and can be prepared and deployed for the chosen network.### Preparing the subgraph for other networks
```bash
# Configures the subgraph for the mainnet and polygon
yarn prepare:config
# Change the network to the testnet
cd packages/protocol
yarn prepare:ropsten
```