All stages of the indexing pipeline—from data extraction to transformation to
persistence—are performed on batches of
blocks to maximize indexing
speed.
Required squid components
Processor
A processor is the main component of your squid. The term refers to both:- The main Node.js process of the squid
- The main object (
processor) of this process, whereprocessor.run()is the entry point
processor objects handle data retrieval and transformation; data persistence is handled by a separate object called Store.
For Substrate chains
UseSubstrateBatchProcessor via the @subsquid/substrate-processor NPM package for Substrate-based networks like Polkadot and Kusama.
Unlike EVM chains, Substrate chains require an RPC endpoint for metadata retrieval, in addition to the SQD Network gateway.
Store
A store is an object that processors use to persist their data. SQD offers three store classes:TypeORM Store (PostgreSQL)
UseTypeormStore for saving data to PostgreSQL. Requires three packages:
@subsquid/typeorm-store@subsquid/typeorm-codegen(code generator, install with--save-dev)@subsquid/typeorm-migration
File Store
Usefile-store via @subsquid/file-store for saving data to filesystems. This is a modular system with a variety of extensions for various formats and destinations.
BigQuery Store
Usebigquery-store via @subsquid/bigquery-store for saving data to Google BigQuery.
Optional squid components
Typegen
A typegen is a tool for generating utility code for technology-specific operations such as decoding.For Substrate chains
Usesquid-substrate-typegen via @subsquid/substrate-typegen to generate type-safe interfaces for:
- Substrate events
- Extrinsics (calls)
- Storage items
- Runtime constants
Install typegen packages with
--save-dev as they are only needed during
development.Types Bundle
For Substrate chains with metadata version below 14, you may need a types bundle to properly decode historical data.GraphQL server
Squids that store their data in PostgreSQL can make it available as a GraphQL API via a variety of supported servers. See Serving GraphQL. SQD provides its own server called OpenReader via the@subsquid/graphql-server package. The server runs as a separate process with these features:
- Core API automatically derived from the schema file
- Extensible with custom queries
- Basic access control support
Squid CLI
Squid CLI is a utility for managing your squid development workflow:- Retrieve squid templates
- Manage chains of commands commonly used in development
- Run all squid processes at once
- Deploy to SQD Cloud

