back to research
web3systemsengineering

What Solana Developers Get Wrong About Indexing

Indexing is how your protocol is understood

Chaitanya

Most Solana developers treat indexing as an infrastructure problem.

Something you “add later.” Something off-chain, and therefore secondary.

This is a mistake.

On Solana, indexing is not an implementation detail. It is a protocol design decision.

If you don’t design how your program is indexed, you are implicitly letting downstream consumers define what your protocol means.

Indexing is how your protocol is understood

The Solana runtime does not preserve intent. It preserves state transitions.

Solana does not define a canonical, protocol-level semantic history, only raw transaction and state data. Everything downstream: APIs, analytics, dashboards, notifications, governance, relies on an interpretation of account changes over time.

Indexing is the translation layer between:

  • raw state mutations, and
  • meaningful protocol-level events.

If that translation is ambiguous, your protocol becomes ambiguous.

Events vs state is not a binary choice

Indexing is often framed as a tradeoff:

  • emit events, or
  • reconstruct from account state.

This framing is incomplete.

Program logs and emitted events are non-canonical. They are useful for observability and UX, but they are not consensus-critical state. They depend on consumer interpretation and schema stability.

Account state is canonical. Given the same transactions, the same state can always be derived.

Mature Solana protocols treat events as hints not truth, and ensure that every critical invariant can be reconstructed from state alone.

If losing an event breaks your indexer, your protocol is fragile.

Replayability is non-negotiable

An indexer that cannot be replayed from genesis (or a trusted snapshot) is not infrastructure, it is technical debt.

Replayability matters because:

  • indexers crash,
  • schemas evolve,
  • bugs ship,
  • consumers change.

If historical views cannot be deterministically rebuilt, trust erodes quickly, especially once real money and governance are involved.

On Solana, replayability is not optional. Throughput magnifies mistakes instead of hiding them.

Your account model is your indexing model

Indexing complexity is almost always a symptom of poor account design.

Common causes:

  • overloaded “god” accounts,
  • hot PDAs with unrelated responsibilities,
  • implicit relationships encoded only in instruction context,
  • unversioned or unstable account layouts.

When relationships are implicit, indexers are forced to infer meaning off-chain. At that point, they stop being deterministic processors and become interpreters.

Well-designed programs make indexing boring:

  • explicit relationships,
  • stable schemas,
  • versioned data structures,
  • narrowly scoped accounts.

Critical invariants should be mechanically derivable, not guessed.

A concrete example: domain ownership indexing

Consider a Solana-based naming or domain protocol.

A naïve design might emit an event like:

“Domain X transferred from A to B”

An indexer that relies primarily on this event can build a clean ownership timeline, until:

  • an event is missed,
  • the schema changes,
  • or a historical bug is discovered.

A robust design instead makes ownership derivable from state:

  • a domain account with an explicit owner field,
  • versioned layout changes,
  • clear parent–child relationships between registries and names.

Events can still exist for UX and notifications, but the indexer’s source of truth is the account graph. If the indexer is wiped, ownership history can be rebuilt deterministically by replaying state transitions.

That difference determines whether the protocol survives long-term.

Off-chain does not mean optional

Most users never interact with your protocol directly through the chain.

They interact with:

  • indexed APIs,
  • cached views,
  • derived state.

In practice, the indexed representation is the product.

If that representation is brittle, inconsistent, or non-replayable, your protocol is brittle, regardless of how correct the on-chain logic is.

Solana’s speed does not compensate for poor indexing design. It exposes it faster.

Design for the reader, not just the runtime

The runtime cares about accounts, instructions, and compute units.

Humans care about:

  • who did what,
  • to which asset,
  • under what conditions,
  • and in what order.

Indexing is where that translation happens.

The best Solana programs are written twice:

  • once for the runtime,
  • once for the reader.

When those diverge, complexity accumulates silently.

Indexing is protocol surface area

Treat your indexed view like part of the spec.

Document it. Version it. Break it deliberately when necessary.

Because once other teams build on top of your indexed interpretation, it becomes your protocol, whether you intended it or not.

Solana gives you powerful execution primitives. Meaning is still your responsibility.

If you don’t design how your protocol is indexed, you’re outsourcing understanding to chance.

And that’s rarely a good architectural decision.