Quickstart
This 5-minute tutorial shows you how to grab a Solana Squid SDK indexer template. At the end you’ll have a complete blockchain indexer that fetches, decodes, and serves data on Whirlpool swaps on the USDC-SOL pair.What you’ll get
Your Solana indexer (squid) will:- Fetch all historical USDC-SOL swaps made on Whirlpool
- Save the data to a local PostgreSQL database
- Start a GraphQL server with a rich API to query the indexed swaps
This tutorial focuses on Solana. For other chains, see the EVM Quickstart or Substrate Quickstart.
Prerequisites
Before you begin, ensure you have:- Node.js v20+ - Download here
- Git - Download here
- Docker - Download here (for running PostgreSQL)
- WSL (Windows only) - Install WSL
(Optional) Install Squid CLI
Install the Squid CLI globally:
Verify installation by running
sqd --versionScaffold the indexer project
Create a new squid project from the Whirlpool USDC-SOL swaps example:or, if you skipped the installation of Squid CLI
Inspect the project structure
Explore the project structure:The Next,
Key files explained: -
src/abi - Utility modules generated from
the Whirlpool program IDLs (src/abi/whirlpool) and handwritten
(src/abi/token-program.ts) used in filtering and decoding of
program data - src/model/ - TypeORM model classes used in database
operations - main.ts - Main executable containing data retrieval
configuration and processing logicmain.ts file first defines the data source object and configures its data retrieval options:main.ts
main.ts defines the data processing and storage logic. Data processing is defined in the batch handler, the callback that the run() function as its final argument:main.ts
Install dependencies and build
Install dependencies and build the project:
Verify the build completed successfully by checking for the
lib/ directory.Start the database and processor
The processor continuously fetches data, decodes it, and stores it in PostgreSQL. All logic is defined in Apply database migrations:Then start the processor:
main.ts and is fully customizable.First, start a local PostgreSQL database (the template includes a Docker Compose file):The indexer is now running and will begin processing blocks.
Query the data
You can now query your indexed data! Check it out at the GraphiQL playground at localhost:4350/graphql.

