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

              Fraxtal Mainnet

              Subgraphs
              Payments: Subgraph Studio⁠Indexing: Community Support
              Type
              mainnet
              Protocol
              ethereum
              Identifier
              fraxtal
              Chain ID
              eip155:252
              Native Currency
              FRAX
              Chain Docs
              Fraxtal Docs⁠

              Indexing Data on Fraxtal

              Fraxtal is an Ethereum Layer 2 built on the OP Stack by Frax Finance, designed around the Frax stablecoin and staking ecosystem. 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.

              Fraxtal is supported by The Graph with Subgraphs — open APIs you publish to The Graph Network, where Indexers sync and serve the data while you manage your service in Subgraph Studio.


              Indexing Fraxtal with Subgraphs

              Get API Key

              Getting smart contract data is hard. You write your own indexer, run your own database, and handle chain reorganizations yourself. Subgraphs remove that work, giving you an open API that you query with GraphQL.

              Fraxtal is EVM-compatible, so the Subgraph workflow is the same as on most EVM chains. You point a Subgraph at your Fraxtal contract, define the entities you want, deploy and publish it through Subgraph Studio, and Indexers on The Graph Network keep those entities current and queryable.

              This network does not have Subgraph Studio indexing support. Publish your Subgraph to The Graph Network to get indexing support on Fraxtal. InfraDAO provides indexing support for all published Subgraphs with 500+ GRT in signal on Fraxtal Mainnet.

              Search Graph Explorer for Existing Subgraphs

              Before you build, check whether the data you need is already live. Graph Explorer lists every Subgraph published to The Graph Network:

              • Filter by network: on the Subgraphs page, filter by Fraxtal to see the Subgraphs indexing it, then sort by most queried, most curated, or recently updated.
              • Search by contract: enter a contract address in the search bar to find the Subgraphs that index it.
              • Try it first: open any Subgraph to test queries in its playground and copy its query URL.

              If an existing Subgraph covers your use case, skip to querying it with your API key. For a full tour, see Using Graph Explorer.

              Quick Start: Build Your Own Subgraph

              Building a Subgraph for Fraxtal takes five steps:

              1. Create your Subgraph in Subgraph Studio.
              2. Build a Subgraph project from your smart contract.
              3. Deploy it to Subgraph Studio.
              4. Publish it to The Graph Network from Subgraph Studio.
              5. Query Subgraph with your API key.

              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. Create a Subgraph, copy its slug and your deploy key from the Subgraph details page to use in the CLI. For a full walkthrough, see Using Subgraph Studio.

              Step 2: Initialize and build your Subgraph project

              Install the Graph CLI, verify the install, and initialize a project from your Fraxtal contract:

              1# Install the Graph CLI (or with yarn: yarn global add @graphprotocol/graph-cli)2npm install -g @graphprotocol/graph-cli@latest34# Verify the install5graph --version67# Initialize from your Fraxtal contract8graph init

              The CLI walks you through a set of prompts:

              • Protocol: choose ethereum. Fraxtal is EVM-compatible.
              • Subgraph slug: use the slug of the Subgraph you created in Subgraph Studio, for example my-fraxtal-subgraph.
              • Directory: where the project is scaffolded.
              • Ethereum network: select fraxtal from the list of supported networks.
              • Contract address: the address of the contract you want to index. Find it on fraxscan.com.
              • ABI: if the CLI cannot fetch the ABI, export it from your build artifacts or the Fraxscan 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.

              To customize your Subgraph, you work with three files:

              • Manifest: subgraph.yaml defines which data sources your Subgraph indexes.
              • Schema: schema.graphql defines the entities you want to query.
              • Mappings: src/mapping.ts uses AssemblyScript that translates on-chain events into your entities.

              Point the manifest at Fraxtal:

              1dataSources:2- kind: ethereum3  name: MyContract4  network: fraxtal5  source:6    address: '0xYourFraxtalContractAddress'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 and deploy your Subgraph to Subgraph Studio:

              1# Authenticate with the deploy key from your Subgraph details page2graph auth <DEPLOY_KEY>34# Deploy to Subgraph Studio (the CLI asks for a version label such as 0.0.1)5graph deploy <SUBGRAPH_SLUG>

              Deploying uploads your Subgraph to Subgraph Studio so you can publish it from the dashboard. Subgraph Studio does not index Fraxtal, so the deployment does not sync in the Studio playground. To check your Subgraph before publishing, verify it locally with Graph Node Dev Mode (below).

              Optional: Verify locally with Graph Node Dev Mode

              Run your Subgraph on your machine with Graph Node Dev Mode (GND), pointed at an RPC endpoint for Fraxtal. From your Subgraph project directory:

              1# Install gnd with the Graph CLI2graph node install34# Build, deploy, and index your Subgraph locally, redeploying on changes5gnd --ethereum-rpc fraxtal:https://rpc.frax.com --watch

              Query your Subgraph at http://localhost:8000/subgraphs/name/subgraph-0/ until your entities look right, then publish. On Windows, gnd also needs a --postgres-url. See Graph Node Dev Mode for setup.

              Step 4: Publish & Curate on The Graph Network

              Publishing is how your Subgraph gets indexed on Fraxtal.

              Publishing a Subgraph is an on-chain action that:

              • makes it available for Curators to add signal that attracts Indexers,
              • makes your Subgraph available for decentralized Indexers to index,
              • and makes it publicly searchable and queryable in Graph Explorer.

              To publish, open your Subgraph in the Subgraph Studio dashboard and click Publish. Connect your wallet, add metadata (name, description, image), and confirm the transaction. Publishing happens on Arbitrum One, where The Graph’s protocol contracts live, not on Fraxtal. For details, see Publishing a Subgraph, which also covers publishing from the CLI with graph publish.

              During the publish transaction, you can add GRT in curation signal to save on gas fees. Signal tells Indexers that your Subgraph is worth indexing. Any Subgraph with 500 GRT or more signal will automatically be indexed; without signal, no Indexer is incentivized to pick up your Subgraph.

              Step 5: Query your Subgraph

              After you publish, open your Subgraph in Graph Explorer and copy its query URL from the Query button.

              1. Create an API key from the API Keys dashboard at thegraph.com/studio. This dashboard handles API keys and billing for The Graph Network.
              2. Send GraphQL queries to the query URL with your API key.

              See the Subgraph pricing page for query rates, and 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