explaingit

subquery/subql

18,805TypeScriptAudience · developerComplexity · 4/5MaintainedLicenseSetup · hard

TLDR

Open-source framework that reads blockchain data, processes it with custom rules, and exposes it via GraphQL so apps can query it like a database.

Mindmap

mindmap
  root((SubQuery))
    What it does
      Indexes blockchain data
      Transforms raw events
      Exposes GraphQL API
    Supported chains
      Polkadot
      Ethereum & EVM
      Cosmos, Solana
      Multi-chain indexing
    How to use it
      Define manifest file
      Write TypeScript mappers
      Run indexer node
      Query via GraphQL
    Deployment options
      Local development
      Self-hosted
      SubQuery Network
    Use cases
      DeFi dashboards
      NFT explorers
      Governance tools

Things people build with this

USE CASE 1

Build a DeFi dashboard that tracks token swaps, liquidity pools, and user balances across multiple blockchains.

USE CASE 2

Create an NFT explorer that indexes transfers, ownership history, and metadata for a collection.

USE CASE 3

Develop a governance tool that tracks voting events and proposal history for a DAO.

USE CASE 4

Index real-time transaction data for a wallet tracker or portfolio monitoring app.

Tech stack

TypeScriptPostgreSQLGraphQLNode.jsPolkadotEthereum

Getting it running

Difficulty · hard Time to first run · 1day+

Requires PostgreSQL setup, blockchain node connection, and understanding of indexing rules before first query succeeds.

Open source under Apache 2.0, use freely for any purpose, including commercial, as long as you include the license notice.

In plain English

SubQuery is an open source data indexing framework for blockchain (web3) applications. The core problem it solves is that blockchains store raw transaction and event data in a format that is very hard to query, if your app needs to ask questions like "show me all NFT transfers for this wallet" or "what happened to this smart contract over the past week," you can't just run a SQL query against the chain. SubQuery sits between the blockchain and your app: it reads raw on-chain data, processes it according to rules you define, stores it in a PostgreSQL database, and exposes it through a standard GraphQL API that your frontend can query quickly. It supports a wide range of blockchains including Polkadot, Ethereum and EVM-compatible networks, Cosmos, Algorand, NEAR, Stellar, Solana, Starknet, and others, and you can even index data across multiple chains at once. You define what data to capture using a project manifest and TypeScript mapping functions, then run the SubQuery indexer node alongside a GraphQL query service. Projects can be run locally for development, self-hosted on your own infrastructure, or published to the decentralized SubQuery Network where others host your indexer for you. You would use SubQuery if you are building a decentralized app, such as a DeFi dashboard, an NFT explorer, or a governance tool, and need reliable, fast access to historical and real-time blockchain data without building your own data pipeline from scratch.

Copy-paste prompts

Prompt 1
How do I set up a SubQuery project to index Ethereum token transfers and expose them via GraphQL?
Prompt 2
Show me an example TypeScript mapping function that transforms raw blockchain events into queryable data in SubQuery.
Prompt 3
What's the difference between running SubQuery locally versus publishing to the SubQuery Network?
Prompt 4
How can I index data from multiple blockchains at once using SubQuery?
Prompt 5
Walk me through deploying a SubQuery indexer for a Polkadot smart contract to production.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.