Severity: Critical (as filed) · Area: API / Infra (api/_lib/indexer/, api/cron/index-tokens.ts) · Status: ✅ Resolved — re-verified against the tree on 2026-08-19
Description
Original defect. .kiro/specs/contract-event-indexing/ was an empty directory: the team had named the gap but not scoped or built it. The frontend's entire data layer ran on live synchronous RPC calls with a short-TTL in-memory cache as the only persistence, which truncated the explorer at the RPC's 100-event page cap, made pagination latency-bound, and meant any RPC outage took down all reads at once.
Why this is now closed. The spec is filled in and the indexer is built:
api/_lib/indexer/ implements the layer behind a TokenStore seam (types.ts), with backfill / steady-state paging / reconciliation (ingest.ts), Soroban RPC reads (sorobanChain.ts), and both a Postgres (postgresStore.ts) and in-memory (memoryStore.ts) store.
api/cron/index-tokens.ts is the scheduled ingest entrypoint, authenticated with CRON_SECRET and failing closed in production when unconfigured.
api/tokens/index.ts and api/tokens/[address].ts serve the paginated query surface the issue asked for; api/health/indexer.ts exposes ingest lag.
docs/indexer.md documents the design and — importantly for this issue's acceptance criteria — states the fallback contract explicitly: the indexer is never a source of truth, every value it serves is re-derivable from the chain, and a broken or stale indexer degrades to direct RPC rather than failing reads. Rollback is a feature flag.
Two residual gaps were found during the 2026-08 audit and are tracked separately, because each is a distinct defect rather than unfinished scope on this issue:
Tasks
Acceptance Criteria
Re-verified on 2026-08-19 during the 30-issue codebase audit tracked in ISSUES.md, which excludes this issue as already fixed.
Severity: Critical (as filed) · Area: API / Infra (
api/_lib/indexer/,api/cron/index-tokens.ts) · Status: ✅ Resolved — re-verified against the tree on 2026-08-19Description
Original defect.
.kiro/specs/contract-event-indexing/was an empty directory: the team had named the gap but not scoped or built it. The frontend's entire data layer ran on live synchronous RPC calls with a short-TTL in-memory cache as the only persistence, which truncated the explorer at the RPC's 100-event page cap, made pagination latency-bound, and meant any RPC outage took down all reads at once.Why this is now closed. The spec is filled in and the indexer is built:
api/_lib/indexer/implements the layer behind aTokenStoreseam (types.ts), with backfill / steady-state paging / reconciliation (ingest.ts), Soroban RPC reads (sorobanChain.ts), and both a Postgres (postgresStore.ts) and in-memory (memoryStore.ts) store.api/cron/index-tokens.tsis the scheduled ingest entrypoint, authenticated withCRON_SECRETand failing closed in production when unconfigured.api/tokens/index.tsandapi/tokens/[address].tsserve the paginated query surface the issue asked for;api/health/indexer.tsexposes ingest lag.docs/indexer.mddocuments the design and — importantly for this issue's acceptance criteria — states the fallback contract explicitly: the indexer is never a source of truth, every value it serves is re-derivable from the chain, and a broken or stale indexer degrades to direct RPC rather than failing reads. Rollback is a feature flag.Two residual gaps were found during the 2026-08 audit and are tracked separately, because each is a distinct defect rather than unfinished scope on this issue:
cronsentry in eithervercel.json, so ingest never runs in production.Tasks
contract-event-indexingspec./api/tokens,/api/tokens/:address)./api/health/indexer).Acceptance Criteria
docs/indexer.mdplus.kiro/specs/contract-event-indexing/).Re-verified on 2026-08-19 during the 30-issue codebase audit tracked in
ISSUES.md, which excludes this issue as already fixed.