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 their arguments and accounts from an IDL (Anchor, Shank or Codama) or a layout you declare, and writes the results to Postgres with an auto-generated GraphQL API. Inner instructions (CPIs), account balance activity, 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.

Stable since v3.11

The SVM API - configuration, handlers and payload types - is final and follows semver like the rest of HyperIndex. Building on Solana? Say hello on Discord; we'd love your input on what to prioritize next.

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 per-account balance activity.
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 the USDC Transfers template - a working SPL Token instruction indexer with tests. See Getting Started for the full walkthrough.

The HyperSync endpoint comes from the chain id, so there's nothing to configure beyond picking a start_slot - see choosing a start slot.

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)
Block (onBlock)Slot (onSlot)
event.paramsinstruction.args

EVM vs Solana has the full mapping.

What's supported today

  • Instruction indexing via indexer.onInstruction: match by program + discriminator.
  • IDL-aware decoding: point at an Anchor (legacy or 0.30+), Shank or Codama IDL and every instruction it declares becomes indexable, with its arguments and account names. No IDL? Declare the layout yourself.
  • Inner instructions (CPIs): decoded the same way as top-level ones, with a full instruction path so you can reconstruct the call tree.
  • Account activity: pre/post lamport and SPL Token (and Token-2022) balances per account, so you get net value movement without indexing every transfer. See account activity.
  • Transaction metadata & logs: fee payer, fee, compute units, success, the transaction signature, and per-instruction program logs (opt-in via the handler's fields option).
  • 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

These are gaps in the built-in instruction-handler surface, not hard limits: for most of them you can still pull the data yourself by calling out to RPC from a handler with the Effect API, you just don't get it as a struct field for free.

  • Account-change subscriptions. There is no onAccount/program-account handler. instruction.accounts gives you the accounts an instruction touched and, with fields.accountActivity, their pre/post lamport and token balances for that transaction - but not arbitrary account state. For that, read the account over RPC in a handler with the Effect API.
  • A separate log handler. Logs are a field on the instruction, not their own handler.
  • Dynamic registration. No Solana equivalent of dynamic contracts: programs are declared in config.yaml, not registered at runtime.
  • Wildcard indexing across programs. A registration always names one program.
  • No-code contract import. Solana has no contract-import flow, so you configure programs by hand. (IDLs are wired up in config.yaml, not auto-imported.)
  • ReScript. Solana indexers are TypeScript only. Codegen emits no ReScript for ecosystem: svm, and envio init silently picks TypeScript if you ask for ReScript.

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