For AI agents: the documentation index is at /llms.txt. Markdown versions of pages are available by appending .md to the URL.
Skip to main content

Indexing on Solana

HyperIndex indexes Solana programs at the instruction level. You select the programs and instructions you care about, HyperIndex decodes them — arguments and accounts — using your Anchor IDL or an inline schema, and writes the results to Postgres with an auto-generated GraphQL API. Inner instructions (CPIs), token balances and balance changes, transaction metadata and program logs are all available.

It is powered by HyperSync for Solana, the same high-performance data engine behind EVM indexing, so historical backfills are fast and you never touch an RPC node for the bulk of indexing.

Early access — and a good time to shape it

Solana support is experimental and pre-release. The program/instruction config surface (programs_experimental) may change, indexers are TypeScript-only, and the indexer tracks finalized data (no reorg handling — see below). The APIs documented here are the latest in active development. If you're building on Solana, say hello on Discord — we can tell you which pieces are stable, which are moving, and often suggest a better data path for your use case.

Two ways to index Solana

ApproachAPIData sourceUse it for
Instruction handlersindexer.onInstructionHyperSyncThe main path — decode and index program instructions (swaps, deposits, mints, transfers…), including inner/CPI instructions, with token balance changes.
Slot handlersindexer.onSlotRPC (via the Effect API)Per-slot orchestration, time-series snapshots, or pulling extra data from RPC on a schedule.

Most indexers use instruction handlers. Slot handlers are for cases where you need to run logic on a slot cadence rather than react to a specific instruction. For raw, low-level data you can also query HyperSync for Solana directly.

Quickstart

pnpx envio init

Choose Solana when prompted, then pick a starter template (a Metaplex NFT instruction indexer, or a minimal slot handler). See Getting Started for the full walkthrough.

Mental model: coming from EVM?

If you've used HyperIndex on EVM, the shift is mostly vocabulary:

EVMSolana
Contract + ABIProgram + IDL
Event (onEvent)Instruction (onInstruction)
event.paramsevent.instruction.decoded.args
Topic0 / event signatureInstruction discriminator
Block (onBlock)Slot (onSlot)
Hex addresses 0x…Base58 addresses
start_block = block numberstart_block = slot number

See EVM vs Solana for the full picture.

What's supported today

  • Instruction indexing via indexer.onInstruction — match by program + discriminator.
  • IDL-aware decoding — point at a standard Anchor IDL (legacy or 0.30+) and HyperIndex derives the argument and account layout. No IDL? Declare an inline schema.
  • Inner instructions (CPIs) — decoded the same way as top-level ones, with a full instruction-address path so you can reconstruct the call tree.
  • Token balances & balance changes — pre/post SPL Token (and Token-2022) balances per transaction, so you get the net token movement without indexing every transfer. See token balances.
  • Transaction metadata & logs — fee payer, fee, compute units, success, signatures, and per-instruction program logs (opt-in via field selection).
  • Slot handlers via indexer.onSlot + the Effect API for RPC enrichment.
  • Local dev + GraphQL + Envio Cloud — the same workflow and hosting as EVM.

What is not supported yet

  • Reorg handling. Solana indexers track finalized data only; there is no rollback-on-reorg. Expect a short latency at the head.
  • Native SOL balance fields on handlers. Pre/post token balances are surfaced today; native SOL (lamport) balances are available via HyperSync directly but not yet as a handler field-selection toggle.
  • Account-change subscriptions. There is no onAccount/program-account handler. Account state is available only as the accounts referenced by an instruction (plus per-transaction token balances).
  • A separate log handler. Logs are a field on the instruction event, not their own handler.
  • No-code contract import. Solana has no contract-import flow — you configure programs/instructions by hand. (IDLs are wired up in config.yaml, not auto-imported.)
  • ReScript. Solana indexers are TypeScript only.
  • Per-field selection. Field-selection toggles accept true only, not field name lists (yet).

If the piece you need is on this list, tell us on Discord — there's a good chance we can sequence the work to unblock you, or point you at a HyperSync-direct path that gets the data today.

In this section