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.
Both start from the same Portal stream. Follow each path to see where your data ends up.
Both are TypeScript, open source, and built on Portal. The difference is what you end up running.
Swipe to compare both SDKs
Answer the questions that apply to you. A recommendation appears as soon as your answers point one way.
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.
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.
Index EVM, Solana, Substrate, and Tron from one framework. Substrate support covers runtime events and calls, Frontier EVM logs, and ink! contracts.
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.
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.
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 sourceList 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.
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.
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.
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.
Streams for EVM, Solana, Bitcoin, Tron, and Hyperliquid fills, such as evmPortalStream() and solanaPortalStream(). All five compose the same way over the same Portal.
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.
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.
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().
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.
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.
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.
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 specBoth SDKs are built in the open. Read the code, open an issue, or start a project with one command.
Squid SDK
Pipes SDK
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.
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.EvmBatchProcessor sets the depth with setFinalityConfirmation().--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.@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
Private Portal. Dedicated. Validated. Managed. Tell us what you're building, we'll show you what it looks like on SQD.