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
| Contract | Event | Table |
|---|---|---|
MerkleTree | LeafInserted | merkle_leaf |
Vault | Deposited | vault_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 ← PonderOn 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 :42069Re-run resolve-addresses after contract redeploys.
Failure modes
| Scenario | Behavior |
|---|---|
| Indexer down | RPC fallback |
| Backfill incomplete | Balances may under-count until caught up |
| Chain reorg | Ponder rolls back affected rows |
See the siphon-indexer repo for full deployment and API reference.