@darkpool/server processes. It polls Sui events on a configurable interval (INDEXER_POLL_MS, default 4000ms) and writes them to Postgres via Drizzle. Cursor state is persisted in the indexer_cursors table so restarts resume cleanly.
Streams

One indexer process owns several event streams, each scoped to a different package. Cursor state is persisted per stream so restarts resume cleanly.
One
binary::<slug> stream is created per .binary-markets/registry.json entry at startup. New markets need an indexer restart before their event stream exists.
Cursors
sui.queryEvents({ MoveEventType: … }) with the stored cursor; on success the new tail cursor is upserted in the same transaction.
Logs
Database schema
Drizzle schema lives inpackages/server/src/db/schema.ts. Migrations under packages/server/src/db/migrations/. Run:
migrate Docker service runs this as a one-shot at compose-up.
Inspection
What’s not indexed yet (v0.4 follow-ups)
binary::<slug>::settlement::MarketCreated/PairMinted/MarketResolvedare not indexed./v1/binary-marketsreads chain state directly, which is fine at this scale.predict_facade::*attribution events are not indexed. The router relies on the underlyingpredict::*events instead.- Pause / resume of agents is not indexed (no events emitted by Move). The UI reads
is_activelive viasui.getObject.

