Skip to main content

SDK Overview

A squid is an indexing project built with Squid SDK to retrieve and process blockchain data from the SQD Network. The Squid SDK is a set of open-source TypeScript libraries that retrieve, decode, transform, and persist blockchain data.
All stages of the indexing pipeline—from data extraction to transformation to persistence—are performed on batches of blocks to maximize indexing speed.
The modular architecture of the SDK makes it possible to extend indexing projects (squids) with custom plugins and data targets.

Required squid components

Processor

A processor is the main component of your squid. The term refers to both:
  1. The main Node.js process of the squid
  2. The main object (processor) of this process, where processor.run() is the entry point
processor objects handle data retrieval and transformation; data persistence is handled by a separate object called Store.

For EVM chains

Use EvmBatchProcessor via the @subsquid/evm-processor NPM package for Ethereum-compatible networks.

Store

A store is an object that processors use to persist their data. SQD offers three store classes:

TypeORM Store (PostgreSQL)

Use TypeormStore for saving data to PostgreSQL. Requires three packages:

File Store

Use file-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

Use bigquery-store via @subsquid/bigquery-store for saving data to Google BigQuery.
You can mix and match any store class with any processor class.

Optional squid components

Typegen

A typegen is a tool for generating utility code for technology-specific operations such as decoding.

For EVM chains

Use squid-evm-typegen via @subsquid/evm-typegen to:
  • Decode smart contract data
  • Handle direct calls to contract methods
  • Access useful constants such as event topics and function signature hashes
The generated code depends on @subsquid/evm-abi, SQD’s high-performance, open-source EVM codec.
Install typegen packages with --save-dev as they are only needed during development.

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:

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