Join the discussion on Telegram
Why this matters
docs/ARCHITECTURE.md exists but does not explain the backend's event-indexing and real-time data path, which is the most confusing part of the system for new contributors. Specifically, the docs don't cover:
- How on-chain events flow: Soroban RPC →
SorobanEventWorker (backend/src/workers/soroban-event-worker.ts) → Prisma StreamEvent/Stream tables → SSE broadcast → frontend useStreamEvents.
- The dedup model (
@@unique([transactionHash, eventType])) and the indexer cursor/IndexerState mechanism.
- How the read path falls back to live RPC when DB rows are stale (
isStale in backend/src/services/sorobanService.ts).
- The custodial vs. wallet-signed action split (top-up uses a server
KEEPER_SECRET_KEY; withdraw/pause/resume currently only simulate server-side and the real tx is signed by the frontend).
- Which secrets are required to run the full stack end to end.
Without this, contributors duplicate work or wire actions incorrectly.
Acceptance criteria
Files to touch
Out of scope
- Code changes to the indexer or signing model.
Join the discussion on Telegram
Why this matters
docs/ARCHITECTURE.mdexists but does not explain the backend's event-indexing and real-time data path, which is the most confusing part of the system for new contributors. Specifically, the docs don't cover:SorobanEventWorker(backend/src/workers/soroban-event-worker.ts) → PrismaStreamEvent/Streamtables → SSE broadcast → frontenduseStreamEvents.@@unique([transactionHash, eventType])) and the indexer cursor/IndexerStatemechanism.isStaleinbackend/src/services/sorobanService.ts).KEEPER_SECRET_KEY; withdraw/pause/resume currently only simulate server-side and the real tx is signed by the frontend).Without this, contributors duplicate work or wire actions incorrectly.
Acceptance criteria
docs/ARCHITECTURE.mdwith a simple data-flow diagram (RPC → worker → DB → SSE → UI).IndexerStatecursor, and the stale-read RPC fallback.backend/.env.example.Files to touch
docs/ARCHITECTURE.mdOut of scope