Siphon Docs
Indexer

Chain Indexer

Ponder service for Merkle leaves and vault deposits.

siphon-indexer is a Ponder service that indexes on-chain privacy-pool state into PostgreSQL.

Why it exists

Reconstructing spendable balance used to require scanning every LeafInserted event from the vault deploy block via chunked eth_getLogs — thousands of RPC calls per balance check on public endpoints.

The indexer scans once, keeps state live, and serves reads over HTTP.

What it indexes

ContractEventTable
MerkleTreeLeafInsertedmerkle_leaf
VaultDepositedvault_deposit

Four vaults and four trees today: ETH + USDC on Base and Ethereum Sepolia.

Read path

The frontend never calls Ponder directly:

siphon-app → trade-executor /vault-index/leaves → Postgres ← Ponder

On indexer failure, the app falls back to RPC eth_getLogs (correct but slow).

Operations

cd siphon-indexer
npm install
cp .env.example .env.local
npm run resolve-addresses >> .env.local
npm run dev   # API on :42069

Re-run resolve-addresses after contract redeploys.

Failure modes

ScenarioBehavior
Indexer downRPC fallback
Backfill incompleteBalances may under-count until caught up
Chain reorgPonder rolls back affected rows

See the siphon-indexer repo for full deployment and API reference.

On this page