Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • AI Tooling
  • Subgraphs
    • Substreams
      • Indexer Software
        • Gateway Software
          • Data Services
            • Resources

              Stable

              Subgraphs
              Subgraph Studio⁠
              Type
              mainnet
              Protocol
              ethereum
              Identifier
              stable
              Chain ID
              eip155:988
              Native Currency
              gUSDT

              Indexing Data on Stable

              Stable is an EVM-compatible Layer 1 built for stablecoin payments, using USDT as its native gas token for fast, low-cost transfers. The Graph can index that onchain activity — DEX swaps, pools, and liquidity; lending and borrowing positions; token transfers and holder balances; and contract events — and serve it over GraphQL with Subgraphs.

              Stable is supported by The Graph with Subgraphs — develop, test, and publish them in Subgraph Studio. Publishing is enabled, though guaranteed indexing via The Graph Network is not yet available for Stable.

              Indexing Stable with Subgraphs

              Getting smart contract data is hard. You write your own indexer, run your own database, and handle chain reorganizations yourself. The Graph removes that work, giving you an open API, called a Subgraph, that you query with GraphQL.

              Stable is EVM-compatible, so the Subgraph workflow is the same as on most EVM chains. You develop and test your Subgraph in Subgraph Studio, then query it through the development endpoint.

              Subgraph publishing is enabled for Stable, but no guaranteed indexing is available via The Graph Network at this time. You can develop, test, and publish your Subgraph in Subgraph Studio, but Indexers on the decentralized network are not guaranteed to index and serve it yet.

              Quick Start: Build Your Own Subgraph

              Building a Subgraph for Stable takes four steps:

              1. Create your Subgraph in Subgraph Studio.
              2. Initialize a Subgraph project from your Stable contract.
              3. Deploy it to Subgraph Studio and test it in the playground.
              4. Query it over GraphQL with the development endpoint.

              See the Subgraph pricing page for current query rates and free-tier limits.

              Step 1: Create your Subgraph in Subgraph Studio

              Open Subgraph Studio and connect your wallet (MetaMask, Coinbase Wallet, WalletConnect, or Safe). Create a Subgraph, then copy its slug and your deploy key from the Subgraph details page — you use both from the CLI. For a full walkthrough, see Using Subgraph Studio.

              Step 2: Initialize your Subgraph project

              Install the Graph CLI with the package manager you prefer:

              1# npm2npm install -g @graphprotocol/graph-cli@latest34# or yarn5yarn global add @graphprotocol/graph-cli

              Initialize from your Stable contract:

              1graph init

              The CLI walks you through a set of prompts:

              • Protocol: choose ethereum. Stable is EVM-compatible.
              • Subgraph slug: use the slug of the Subgraph you created in Subgraph Studio, for example my-stable-subgraph.
              • Directory: where the project is scaffolded.
              • Ethereum network: select stable from the list of supported networks.
              • Contract address: the address of the contract you want to index. Find it on stablescan.xyz.
              • ABI: if the CLI cannot fetch the ABI, export it from your build artifacts or the Stablescan contract page. Supply it as a JSON file.
              • Start block: the block your contract was deployed at. Set this so indexing does not scan from genesis. The explorer shows the deployment block.
              • Contract name: the name of your contract.
              • Index contract events as entities: set this to true. The CLI then scaffolds entities and mappings for every emitted event.

              Point the manifest at Stable:

              1dataSources:2- kind: ethereum3  name: MyContract4  network: stable5  source:6    address: '0xYourStableContractAddress'7    abi: MyContract8    startBlock: 123456 # your contract's deployment block

              For a full walkthrough of schema and mapping authoring, see Creating a Subgraph. Then generate types and build:

              1graph codegen && graph build
              Step 3: Deploy to Subgraph Studio

              Authenticate the CLI with the deploy key from your Subgraph details page:

              1graph auth <DEPLOY_KEY>

              Then deploy your Subgraph to Subgraph Studio (the CLI asks for a version label such as 0.0.1):

              1graph deploy <SUBGRAPH_SLUG>

              Deploying pushes your Subgraph to Subgraph Studio, where you can test it in the playground and check indexing logs. It does not publish it to the decentralized network — see Using Subgraph Studio for details.

              Step 4: Query your Subgraph

              Once your Subgraph is syncing in Studio, test your queries against the development query URL shown on the Subgraph details page.

              1. Create an API key from the API Keys dashboard at thegraph.com/studio.
              2. Send GraphQL queries to the development query URL with your API key. The development endpoint is rate-limited (currently 3,000 queries per day).

              You can publish your Subgraph to The Graph Network at any time, but Indexers are not guaranteed to serve Stable Subgraphs yet, so the Subgraph Studio development endpoint is the reliable way to query today.

              See Querying The Graph for the full query API.

              Guides

              10 min

              Subgraph quick start

              Kickstart your journey into subgraph development.

              12 min

              Graph Explorer

              Find and query existing blockchain data.

              5 min

              Billing

              Optimize costs and manage billing efficiently.

              5 min

              Timeseries & Aggregations

              Learn to track metrics like daily volumes or user growth.

              7 min

              Advanced subgraph features

              Leverage features like custom data sources, event handlers, and topic filters.

              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service