> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Squid SDK Overview

> Squid SDK architecture overview — processor, batch handlers, schema, and Store roles in building TypeScript blockchain indexers with GraphQL APIs.

A *squid* is an indexing project built with [Squid SDK](https://github.com/subsquid/squid-sdk) to retrieve and process blockchain data from the [SQD Network](/en/network/overview)
(either permissioned or decentralized instance). The Squid SDK is a set of open source Typescript libraries that retrieve, decode, transform and persist the data. It can also make the transformed data available via an API. All stages of the indexing pipeline, from the data extraction to transformation to persistence are performed on [batches of blocks](/en/sdk/squid-sdk/resources/batch-processing) to maximize the indexing speed. Modular architecture of the SDK makes it possible to extend indexing projects (squids) with custom plugins and data targets.

## Required squid components

### Processor

*Processor* is the word used for

1. The main NodeJS process of the squid.
2. The main object (`processor`) of this process: its method call `processor.run()` is the entry point.

`processor` objects handle data retrieval and transformation; data persistence is handled by a separate object called [Store](#store). Squid SDK offers two processor classes:

* [`EvmBatchProcessor`](/en/sdk/squid-sdk/reference/processors/evm-batch) via the [`@subsquid/evm-processor`](https://www.npmjs.com/package/@subsquid/evm-processor) NPM package - for Ethereum-compatible [networks](/en/data/evm)
* [`SubstrateBatchProcessor`](/en/sdk/squid-sdk/reference/processors/substrate-batch) via [`@subsquid/substrate-processor`](https://www.npmjs.com/package/@subsquid/substrate-processor) - for [networks](/en/data/substrate) based on [Substrate](https://substrate.io) such as [Polkadot](https://polkadot.network)

### Store

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

* [`TypeormStore`](/en/sdk/squid-sdk/resources/persisting-data/typeorm) for saving data to PostgreSQL, via

  * [`@subsquid/typeorm-store`](https://www.npmjs.com/package/@subsquid/typeorm-store)
  * [`@subsquid/typeorm-codegen`](https://www.npmjs.com/package/@subsquid/typeorm-codegen) (a code generator, install with `--save-dev`)
  * [`@subsquid/typeorm-migration`](https://www.npmjs.com/package/@subsquid/typeorm-migration)

  Install all three packages to use this store.
* [`file-store`](/en/sdk/squid-sdk/resources/persisting-data/file) via [`@subsquid/file-store`](https://www.npmjs.com/package/@subsquid/file-store) - for saving data to filesystems. It is a modular system with a variety of [extensions](/en/sdk/squid-sdk/reference/store/file) for various formats and destinations.
* [`bigquery-store`](/en/sdk/squid-sdk/resources/persisting-data/bigquery) via [`@subsquid/bigquery-store`](https://www.npmjs.com/package/@subsquid/bigquery-store) - for saving data to [Google BigQuery](https://cloud.google.com/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. Here are the typegens available:

<Tabs>
  <Tab title="On EVM">
    * [`squid-evm-typegen`](/en/sdk/squid-sdk/resources/tools/typegen/generation) via [`@subsquid/evm-typegen`](https://www.npmjs.com/package/@subsquid/evm-typegen):
      * decodes smart contract data
      * handles direct calls to contract methods
      * exposes useful constants such as event topics and function signature hashes
        The generated code depends on [`@subsquid/evm-abi`](https://www.npmjs.com/package/@subsquid/evm-abi), SQD's own high performance, open source EVM codec.
  </Tab>

  <Tab title="On Substrate">
    * [`squid-substrate-typegen`](/en/sdk/squid-sdk/resources/tools/typegen/generation) via [`@subsquid/substrate-typegen`](https://www.npmjs.com/package/@subsquid/substrate-typegen):
      * general purpose pallet data decoding (aware of runtime versions)
      * handles direct storage queries
    * [`squid-ink-typegen`](/en/sdk/squid-sdk/resources/tools/typegen/generation) via [`@subsquid/ink-typegen`](https://www.npmjs.com/package/@subsquid/ink-typegen) for decoding the data of [ink!](https://use.ink) contracts
  </Tab>
</Tabs>

Install these with `--save-dev`.

### GraphQL server

Squids that store their data in PostgreSQL can subsequently make it available as a GraphQL API via a variety of supported servers. See [Serving GraphQL](/en/sdk/squid-sdk/resources/serving-graphql).

Among other alternatives, SQD provides its own server called [OpenReader](/en/sdk/squid-sdk/reference/openreader-server) via the [`@subsquid/graphql-server`](https://www.npmjs.com/package/@subsquid/graphql-server) package. The server runs as a separate process. [Core API](/en/sdk/squid-sdk/reference/openreader-server/api) is automatically derived from the schema file; it is possible to extend it with [custom queries](/en/sdk/squid-sdk/reference/openreader-server/configuration/custom-resolvers) and [basic access control](/en/sdk/squid-sdk/reference/openreader-server/configuration/authorization).

### Misc utilities

<Tabs>
  <Tab title="On EVM">
    * [Squid CLI](/en/sdk/squid-sdk/squid-cli/installation) is a utility for [retrieving squid templates](/en/sdk/squid-sdk/squid-cli/init), managing [chains of commands](https://github.com/subsquid/squid-sdk/tree/master/util/commands) commonly used in development and running [all squid processes at once](/en/sdk/squid-sdk/squid-cli/run). It can also be used for deploying to [SQD Cloud](/en/cloud).
  </Tab>

  <Tab title="On Substrate">
    * [Squid CLI](/en/sdk/squid-sdk/squid-cli/installation) is a utility for [retrieving squid templates](/en/sdk/squid-sdk/squid-cli/init), managing [chains of commands](https://github.com/subsquid/squid-sdk/tree/master/util/commands) commonly used in development and running [all squid processes at once](/en/sdk/squid-sdk/squid-cli/run). It can also be used for deploying to [SQD Cloud](/en/cloud).
    * [`@subsquid/ss58`](https://www.npmjs.com/package/@subsquid/ss58) handles encoding and decoding of SS58 addresses
    * [`@subsquid/frontier`](https://www.npmjs.com/package/@subsquid/frontier) decodes events and calls of the [Frontier EVM pallet](https://paritytech.github.io/frontier/frame/evm.html) to make them decodable with [`squid-evm-typegen`](/en/sdk/squid-sdk/resources/tools/typegen/generation)
  </Tab>
</Tabs>
