The Graph is a decentralized protocol for indexing and querying blockchain data, enabling applications to efficiently retrieve information from networks like Ethereum, Polygon, and Arbitrum. It organizes data into open APIs called subgraphs, which developers can query using GraphQL. This solves the "data availability" problem in Web3, where directly querying a blockchain for specific data is slow and resource-intensive. By providing a reliable, decentralized data layer, The Graph allows dApps to function with the speed and user experience expected of modern web applications.
The Graph
What is The Graph?
The Graph is a decentralized protocol for indexing and querying data from blockchains like Ethereum and IPFS, powering many applications in DeFi and the broader Web3 ecosystem.
The protocol's architecture relies on a network of participants with distinct roles. Indexers operate nodes that index subgraph data and serve queries, staking the native GRT token. Curators signal on high-quality subgraphs by depositing GRT, directing indexers to valuable data sources. Delegators stake GRT with indexers to secure the network without running a node themselves. This incentivized ecosystem ensures data integrity and availability, with participants earning query fees and indexing rewards for their services.
A subgraph is the core data unit, defining which smart contracts to index, the relevant events to track, and how to transform that blockchain data into a queryable format. For example, a Uniswap subgraph would index data on liquidity pools, swaps, and token pairs. Developers query these subgraphs using the flexible GraphQL language, requesting specific datasets like "the last 24 hours of trades for a particular token." This eliminates the need for applications to run their own centralized indexing servers.
The Graph is foundational infrastructure for DeFi, NFTs, and DAO platforms. Major protocols like Uniswap, Aave, and Decentraland use it to power their front-ends and analytics. By providing standardized, decentralized access to blockchain data, The Graph reduces development overhead and centralization risks, fostering a more robust and interoperable Web3 ecosystem. Its network serves billions of queries monthly, making it a critical piece of the decentralized internet's data layer.
How The Graph Works
The Graph is a decentralized protocol for indexing and querying blockchain data, enabling efficient access to on-chain information via a network of specialized participants.
The Graph operates through a decentralized network of participants, each performing a specific role to make blockchain data queryable. Indexers are node operators who stake the native GRT token to run indexing nodes, which process and store subgraph data. Curators signal on high-quality subgraphs by depositing GRT, directing indexing resources. Delegators stake GRT with indexers to secure the network without running a node themselves. Consumers are the end-users, typically dApp developers, who pay query fees to access the indexed data. This ecosystem is coordinated by a Gateway that routes queries to the appropriate indexers.
The core technical unit is the subgraph, an open API specification that defines which blockchain data to index and how to transform it. A subgraph manifest specifies the smart contracts of interest, the relevant events to capture, and the mapping logic written in AssemblyScript that translates raw on-chain data into a structured GraphQL schema. Once deployed, the subgraph is processed by indexers who continuously scan the blockchain, execute the mapping handlers, and store the resulting entities in a queryable database. This process creates a real-time, indexed data layer that is orders of magnitude faster than querying a blockchain node directly.
Query execution is a paid service secured by micropayments. When a consumer application sends a GraphQL query, it is routed through the gateway. Indexers who have indexed the relevant subgraph compete to serve the query. Payment is typically handled via a system like Billing on The Graph Network, where consumers purchase query credits. Each query response includes a cryptographic proof of the indexer's work, and payment is settled on-chain. This model ensures data integrity and creates a sustainable, decentralized marketplace for web3 data infrastructure.
Key Features of The Graph
The Graph is a decentralized protocol for indexing and querying blockchain data. Its core architecture is composed of several distinct roles that work together to provide reliable data APIs.
Ecosystem Usage & Supported Chains
The Graph is a decentralized protocol for indexing and querying blockchain data. Its ecosystem is defined by the networks it indexes and the applications that rely on its subgraphs.
Core Supported Networks
The Graph's hosted service and decentralized network primarily index data from Ethereum Mainnet, the foundational layer for most DeFi and NFT protocols. This includes querying data for ERC-20 tokens, ERC-721 NFTs, smart contract events, and transaction histories. It is the primary data layer for applications like Uniswap and Aave.
Multi-Chain Expansion (Subgraph Support)
Beyond Ethereum, The Graph supports indexing for numerous EVM-compatible chains and Layer 2 networks. Key supported chains include:
- Polygon (Matic)
- Arbitrum
- Optimism
- Avalanche C-Chain
- BNB Smart Chain (BSC)
- Celo
- Gnosis Chain (formerly xDai) Developers deploy identical subgraph schemas to these networks, querying them via network-specific endpoints.
Subgraph: The Core Data Unit
A subgraph defines which blockchain data to index and how to transform it. It consists of a manifest (subgraph.yaml), a schema (GraphQL), and mapping scripts (in AssemblyScript). Once deployed, it creates a queryable GraphQL API endpoint. For example, a Uniswap subgraph indexes pairs, swaps, and liquidity events.
Primary Use Cases & Consumers
The Graph is primarily consumed by dApp frontends and analytics platforms that need efficient, reliable blockchain data. Common use cases include:
- DeFi Dashboards: Displaying pool APYs, token prices, and user positions.
- NFT Marketplaces: Indexing collections, listings, and sales history.
- Block Explorers: Enriching transaction data with decoded log events.
- Governance Platforms: Tracking proposal states and vote tallies.
Query Flow & Integration
An application integrates The Graph by sending GraphQL queries to a specific subgraph endpoint. The flow is:
- Query: App requests data (e.g.,
{ users { id } }). - Indexing: The Graph's node(s) retrieve indexed data from the relevant blockchain.
- Response: Structured data is returned in JSON format via the GraphQL API. This eliminates the need for applications to run their own complex indexing infrastructure.
Network Participant Roles
The Graph is a decentralized protocol for indexing and querying blockchain data. Its network relies on distinct roles to operate the open data layer for Web3.
Fisherman & Arbitrator
Security roles in the dispute resolution layer (Arbitrum-based). A Fisherman challenges potentially incorrect query responses from Indexers by submitting a dispute. An Arbitrator (initially the Graph Council) ultimately resolves these disputes. These roles ensure the integrity and correctness of data served by the network.
- Fisherman Role: Monitors and disputes fraudulent work.
- Arbitrator Role: Adjudicates disputes and slashes malicious actors.
- Purpose: Enforces cryptographic economic security for query results.
What is a Subgraph?
A subgraph is a data indexing protocol that organizes and serves blockchain data for efficient querying via GraphQL.
A subgraph is a manifest that defines how to index and transform blockchain data from a specific smart contract or protocol, such as Uniswap or Aave, into a structured, queryable API. It consists of three core components: a subgraph manifest (subgraph.yaml) that maps data sources, a GraphQL schema that defines the shape of the queryable data, and AssemblyScript mappings that translate raw blockchain events into the entities in the schema. This architecture allows developers to query complex, aggregated on-chain data without running their own indexing infrastructure.
The process begins when a developer deploys a subgraph to The Graph's decentralized network. Indexers then operate nodes that scan the relevant blockchain for events specified in the manifest, run the mapping logic to process these events, and store the resulting data in a queryable database. Delegators and curators participate in the ecosystem by staking GRT tokens to signal on high-quality subgraphs, guiding indexers to the most useful data sets. This creates a market for reliable data indexing.
For developers, using a subgraph means replacing complex, slow direct node calls with fast, single-query GraphQL requests. Instead of filtering thousands of blocks for events, an application can simply query { swaps(first: 10, orderBy: timestamp, orderDirection: desc) { id, amount } } to get the latest swaps from a DEX. This abstraction is fundamental to the user experience of most decentralized applications, powering everything from portfolio dashboards and analytics sites to the core logic of DeFi protocols.
Subgraphs can index data from multiple EVM-compatible networks like Ethereum, Polygon, and Arbitrum, as well as other chains via The Graph's multi-chain support. While The Graph Network offers a decentralized hosting service, developers can also run a subgraph locally using Graph Node or use The Graph's hosted service for prototyping. The choice between decentralized and hosted service involves trade-offs between cost, decentralization, and uptime guarantees.
The ultimate role of a subgraph is to act as the foundational data layer for Web3. By providing a standardized, open method to publish and query blockchain data, it enables composability and interoperability between applications. A well-built subgraph becomes a public good, allowing any developer to build on top of a protocol's indexed data, which accelerates innovation and reduces redundant development effort across the ecosystem.
Example Use Cases
The Graph's decentralized indexing protocol powers a wide range of applications by providing efficient, reliable access to blockchain data. These cards illustrate how subgraphs serve as critical infrastructure for DeFi, NFTs, DAOs, and analytics.
Real-Time Event Listening for dApps
Decentralized applications use subgraphs as a real-time data layer to listen for on-chain events. Instead of polling a node, a dApp can subscribe to a subgraph stream to get instant updates for:
- Newly minted NFTs in a collection
- Completed swaps on a DEX
- Executed votes in a DAO
This pattern is fundamental for building responsive, live-updating user interfaces.
Historical Data for Research & Auditing
Researchers, auditors, and data analysts use The Graph's hosted service and decentralized network to run complex historical queries. This allows for in-depth analysis of:
- Protocol growth metrics over time
- Smart contract interaction patterns
- Token distribution and whale movements
Access to this indexed data is far more efficient than processing raw blockchain data.
The Graph vs. Traditional Indexing
A technical comparison of decentralized subgraph indexing with traditional centralized database indexing approaches.
| Feature / Metric | The Graph (Decentralized) | Traditional Centralized Indexing |
|---|---|---|
Architecture | Decentralized Network (Indexers, Curators, Delegators) | Centralized Server/Cluster |
Data Provenance & Integrity | Cryptographically verifiable via Merkle proofs | Trust-based on operator integrity |
Query Access | Open API via decentralized gateways (GraphQL) | Proprietary or gated API (REST, SQL) |
Censorship Resistance | ||
Uptime / Fault Tolerance | High (distributed node network) | Variable (single points of failure possible) |
Cost Model | Query fee market (GRT), pay-per-query | Fixed infrastructure & operational overhead |
Development & Deployment | Subgraph manifest (open schema definition) | Proprietary ETL pipelines & database schemas |
Protocol Native |
Frequently Asked Questions (FAQ)
Essential questions and answers about The Graph protocol, its core components, and its role in Web3 data infrastructure.
The Graph is a decentralized protocol for indexing and querying blockchain data, primarily from networks like Ethereum and IPFS. It works by organizing data into open APIs called subgraphs, which developers publish to a global marketplace. Indexers run nodes that index subgraph data, Curators signal on high-quality subgraphs, and Delegators stake GRT tokens to Indexers. Consumers pay query fees in GRT to retrieve this structured data via GraphQL APIs, enabling efficient dApp development without running a full node.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.