Open-source TypeScript SDKs

Build indexers your way

Two open-source SDKs on top of SQD Portal. Squid SDK takes you from a schema file to Postgres and a GraphQL API. Pipes SDK streams decoded data into the database you already run.

Squid Full-stack framework
Pipes Composable library

Squid SDK vs Pipes SDK

Both start from the same Portal stream. Follow each path to see where your data ends up.

Portal (streaming)
Rust engine, 110+ networks
.setPortal()evmPortalStream()
Squid SDK
Indexer framework
run(dataSource, db, handler)
Your handler receives blocks in batches
Real time by default
Unfinalized blocks roll back on a reorg
Data stores
Postgres through TypeORM, or file and BigQuery stores
GraphQL API
Generated from schema.graphql
SQD Cloud or self-host
One command to deploy, or your own servers
dApp backends and real-time APIs
Models and migrations generated from your schema
Portal and RPC sources with failover
EVM, Solana, Substrate, Tron
GPL-3.0-or-later, on GitHub since 2021
Status
Stable · Production
In production at GMX, PancakeSwap, and other DeFi teams, and still under active development. The latest @subsquid/evm-processor release is from November 2026.
Pipes SDK
Streaming library
evmPortalStream({ id, outputs })
Pick a stream and declare what to decode
Typed, named outputs
data.transfers, data.swaps…
ClickHouse
Postgres
BigQuery
Parquet
Pub/Sub
Custom
Resume and rollback
Progress is saved in the target itself
Your analytics / app
Dashboards, AI agents, APIs
Analytics pipelines, warehouses, data lakes
Runs inside your own Node.js service
Your schema, your database
EVM, Solana, Hyperliquid, Bitcoin, Tron
MIT licensed, on GitHub
Status
1.0 beta
The SQD docs recommend it for new TypeScript indexers. On npm as @subsquid/pipes, with eleven 1.0 beta releases between July and October 2026. You host it yourself, since SQD Cloud runs Squid SDK indexers only.
Both read the same Portal stream. They differ in where the data ends up.

Compare the SDKs

Both are TypeScript, open source, and built on Portal. The difference is what you end up running.

Swipe to compare both SDKs

Aspect
Squid SDK
Pipes SDK
What it is
A framework that runs as its own process
A library you import into a Node.js service
Networks
EVM, Solana, Substrate, Tron
EVM, Solana, Hyperliquid, Bitcoin, Tron
Data source
Portal, RPC, or both with failover
Portal
Storage
PostgreSQL through TypeORM, with file and BigQuery stores as separate packages
ClickHouse, PostgreSQL (Drizzle), BigQuery, Parquet, Google Pub/Sub, or a custom target
API layer
GraphQL, generated from schema.graphql
None. You query your own database
ABI decoding
Typed modules generated by sqd typegen
Typed at runtime from a JSON ABI, with no build step
Reorgs
Automatic rollback, on by default
Varies by target. Postgres and BigQuery undo forked writes, Pub/Sub publishes compensating messages, ClickHouse runs your onRollback hook, and Parquet writes finalized blocks only
Scaffolding
sqd init
pipes-cli init
Deployment
SQD Cloud (sqd deploy) or self-hosted
Self-hosted, on Node.js 22.15 or newer
Monitoring
Prometheus metrics, SQD Cloud dashboard
Prometheus, OpenTelemetry, Pipes UI (alpha)
Maturity
Stable, in production
1.0 beta
License
GPL-3.0-or-later
MIT

Which SDK should you use?

Answer the questions that apply to you. A recommendation appears as soon as your answers point one way.

Do you need a GraphQL API generated for you?
Will the data go to ClickHouse, BigQuery, Parquet, or Pub/Sub?
Do you want SQD to host the indexer for you?
Would you rather skip code generation?
Do you index Substrate chains?
Do you index Bitcoin or Hyperliquid?
Squid SDK

Full-stack indexing framework

Describe your data once in a schema file and get the Postgres tables, the migrations, and the GraphQL API. Developed in the open since December 2021.

Real time and history together

Portal serves the full history and the live chain head in the same stream, across 110+ networks. You declare the fields and filters once, and there is no RPC endpoint to configure.

Four chain families

Index EVM, Solana, Substrate, and Tron from one framework. Substrate support covers runtime events and calls, Frontier EVM logs, and ink! contracts.

One transaction per batch

Your handler receives blocks in batches, and each batch commits in one database transaction, so a crash cannot leave a batch half written. Entities and migrations are generated from your schema file.

A GraphQL API from your schema

The same schema file becomes a GraphQL server with filtering, pagination, and optional subscriptions. For teams moving from The Graph, its thegraph dialect serves subgraph-style queries.

Decoding 10x faster than viem

sqd typegen turns a JSON ABI into typed, JIT-compiled decoders. In the repository benchmark on Node 22, they decoded every case more than 10 times faster than viem, and an ERC-20 Transfer event more than 40 times faster.

Benchmark source

Failover across Portal and RPC

List your Portal and RPC sources in order, for EVM or Solana, and the SDK switches when one fails, falls behind, or stalls. A source is trusted only after a probe shows it can serve your query, which catches an RPC node with tracing off or pruned state. Failover state is exported as Prometheus gauges.

Verified RPC blocks

Network presets verify the blocks you read from RPC, using the checks each chain supports. On Ethereum, Base, Optimism, and Arbitrum that covers the block hash, the transaction and receipt roots, the logs bloom, and the recovered transaction senders.

SQD Cloud or your own servers

One command, sqd deploy, puts your indexer on SQD Cloud with managed Postgres and monitoring. Nothing in the SDK depends on the Cloud, so the same code runs on your own servers.

Pipes SDK

Composable streaming library

Import a stream, say what to decode, and pipe the result into your database. The SQD docs recommend Pipes as the starting point for new TypeScript indexers.

Five chain families

Streams for EVM, Solana, Bitcoin, Tron, and Hyperliquid fills, such as evmPortalStream() and solanaPortalStream(). All five compose the same way over the same Portal.

Named, typed outputs

Declare the events you want as named decoders, and each batch arrives typed as data.transfers or data.swaps. Chain .pipe() to transform it and .pipeTo() to store it. Ranges accept block numbers or ISO dates.

Five built-in targets

Write to ClickHouse, PostgreSQL through Drizzle, BigQuery, Parquet, or Google Pub/Sub without writing a sink. The Parquet target writes finalized blocks only and runs in constant memory. For any other store, createTarget() is the extension point.

Resume and reorg rollback

Each target stores a cursor under the pipe id, so a restarted pipe continues where it stopped. When the chain forks, Postgres undoes the affected rows from an undo log and BigQuery deletes them. On ClickHouse, your onRollback hook calls store.removeAllRows().

No code generation

defineAbi() reads a JSON ABI, or a Hardhat or Foundry artifact, and gives you typed decoders at runtime. ERC-20 comes built in through commonAbis, so a transfer indexer needs no ABI file.

Contract factories

Index contracts that do not exist yet. contractFactory() picks up contracts created at runtime, such as new DEX pools, and remembers their addresses between runs in a SQLite store.

Metrics and tracing

Every stream reports its progress, ETA, forks, and Portal requests as Prometheus metrics. For traces, opentelemetryProfiler() exports spans to Jaeger or Tempo. Pipes UI, a dashboard in alpha on npm, reads the same metrics server.

Specified and crash-tested

Pipes has a written behavioral spec. Its conformance suite kills a pipe at every commit step, restarts it, and checks the store against a reference model. For your own tests, mockPortal() plays back a scripted chain.

Read the spec

Read the source

Both SDKs are built in the open. Read the code, open an issue, or start a project with one command.

Squid SDK

subsquid/squid-sdk

License
GPL-3.0-or-later
First commit
December 2021
npm
@subsquid/squid-sdk and per-chain packages
npm i -g @subsquid/cli
sqd init my-squid
Squid SDK quickstart

Pipes SDK

subsquid/pipes-sdk

License
MIT
First commit
September 2025
npm
@subsquid/pipes, 1.0 beta
pnpm dlx @subsquid/pipes-cli init
Pipes SDK quickstart
Data Source

Two SDKs, one data layer

Both SDKs read from SQD Portal. It streams each of 110+ networks over HTTP, with the full history and the live chain head in the same response, so there is no archive node for you to run.

Squid SDK Portal Pipes SDK
Learn about Portal →

Frequently asked questions

What is the Squid SDK?
The Squid SDK is an open-source TypeScript framework for building blockchain indexers. You describe your data in a schema.graphql file and write a batch handler. A data source built with DataSourceBuilder streams filtered blocks from SQD Portal, run() passes them to your handler, and the TypeORM store writes the results to PostgreSQL with generated migrations. The same schema file produces the GraphQL API. Portal serves both history and the chain head, so a squid needs no archive node. Substrate and Tron chains use the SubstrateBatchProcessor and TronBatchProcessor classes.
Are the Squid SDK and Pipes SDK open source?
Yes. Both are developed in public on GitHub and published on npm under open-source licenses. The Squid SDK packages are GPL-3.0-or-later, and the source is at subsquid/squid-sdk, with commit history going back to December 2021. The Pipes SDK packages are MIT, and the source is at subsquid/pipes-sdk. The Portal they both read from is released under AGPL-3.0.
Squid SDK vs Pipes SDK, which should I use?
Both read from the same SQD Portal, and they differ in what you end up running. The Squid SDK is a framework. It comes with a batch processor, a TypeORM store on PostgreSQL, a generated GraphQL API, and a CLI that deploys to SQD Cloud. The Pipes SDK is a library. Its Portal streams and typed decoders write to ClickHouse, PostgreSQL through Drizzle, BigQuery, Parquet, Google Pub/Sub, or a target you write yourself. Pick the Squid SDK for a dApp backend that needs GraphQL, or for Substrate chains. Pick the Pipes SDK when the data belongs in your own database or warehouse. The SQD docs recommend Pipes as the starting point for new TypeScript indexers.
What languages does Squid SDK support?
TypeScript. For teams working in other stacks, the Portal exposes a raw HTTP streaming API documented in the SQD documentation; clients in Go, Python, Rust, or any HTTP-capable language can consume Portal directly without the TypeScript SDKs.
Can I run Squid SDK in production?
Yes. Production teams running on Squid SDK include GMX (multi-chain perpetual DEX), Curvance (lending on Monad), PancakeSwap (multi-chain DEX), RAILGUN (privacy across four chains), and UNCX (seven EVM chains unified). The Portal client retries failed requests, each batch is written in one database transaction, and writes above the finalized head are rolled back when the chain reorganizes. A squid deploys to SQD Cloud for managed hosting and monitoring, or runs on your own servers.
How does Squid SDK handle reorgs?
Without any code from you. A Portal stream includes unfinalized blocks, and the TypeORM store tracks the rows written from them (hot block support is on by default) and rolls those writes back when the chain reorganizes. Finality comes from the Portal stream, so there is no confirmation depth to configure. A squid that ingests from an RPC endpoint through EvmBatchProcessor sets the depth with setFinalityConfirmation().
What's the difference between Squid SDK and subgraphs?
Subgraph mappings are written in AssemblyScript and run inside The Graph's graph-node. A squid is an ordinary Node.js program written in TypeScript: handlers can import any npm package, one project can index several chains, and it runs on SQD Cloud or on your own servers. The GraphQL server also has a --dialect thegraph mode that serves subgraph-style queries. Teams that migrated from The Graph include Curvance and Chillwhales. See the SQD vs The Graph comparison for a detailed breakdown.
Does Squid SDK work with Solana and other non-EVM chains?
Yes. The Squid SDK streams Solana transactions, instructions, logs, balances, token balances, and rewards from the Portal through @subsquid/solana-stream. Substrate parachains and Tron have dedicated batch processors. The Pipes SDK covers EVM, Solana, Hyperliquid, Bitcoin, and Tron (solanaPortalStream(), bitcoinPortalStream(), and so on) with the same composition model used for EVM. See the supported chains for the full list.

Get started

Your blockchain data infrastructure, handled.

Private Portal. Dedicated. Validated. Managed. Tell us what you're building, we'll show you what it looks like on SQD.