OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Solana Example

Solana Example is a TypeScript Subsquid SDK project that demonstrates indexing Orca Exchange USDC-SOL swaps on Solana, decoding blockchain data and storing swap records in PostgreSQL. It also shows how to define type-safe binary codecs for Solana data structures with @subsquid/borsh.

Independent OpenViST project profile, based on linked sources.

Solana Example — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a code-level example of an indexing pipeline from Solana swap data through decoding and PostgreSQL storage, or want to study a pattern for a possible adaptation to another Solana program.

Who it is for

  • Developers learning to build blockchain data indexers with Subsquid SDK.
  • Solana developers who want a concrete Orca swap indexing pattern to study or adapt.

Documented uses

  • Index Orca USDC-SOL swap data from Solana.
  • Store decoded swap records in PostgreSQL and query fields such as slot, token pair and amounts.
  • Define typed Borsh codecs for Solana data structures.
Before you choose

Requirements & limits

  • This is a developer project built with Subsquid SDK, not a hosted indexing app.
  • The documented setup requires Node.js 20 or later and Docker.
  • The README describes Solana support as beta.
  • The shown dataset is Orca Exchange USDC-SOL swaps; indexing another program requires replacing the data source and matching decoding definitions.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Run the Orca swap indexer and query its records

Set up the example’s documented pipeline and inspect indexed swap rows in PostgreSQL.

Before you start

  • Node.js version 20 or later
  • Docker

Steps

  1. Install project dependencies with npm i and compile with npx tsc.

  2. Start the PostgreSQL service using docker compose up -d.

  3. Apply the database migrations with npx squid-typeorm-migration apply.

  4. Launch the indexer with node -r dotenv/config lib/main.js, then use the README’s psql query example to inspect exchange rows.

Expected outcome

The example is configured to index Orca USDC-SOL swaps into PostgreSQL, where the documented query selects slots, token pairs and amounts.

Guide limitations

  • The README identifies Solana support as beta.
  • The repository demonstrates Orca USDC-SOL swaps; it does not demonstrate adapting the indexer to another program.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
subsquid-labs/solana-example · Official homepage title · retained in its source language