Events + DB Mapping
This mapping shows how on-chain events (including forecasting) are normalized into relational tables for query performance.
- On-chain events remain the canonical truth; Postgres tables are indexed projections.
APIandWorkerare the only Postgres writers.- Forecasting data is first-class: market creation, share trades, resolution, and redemptions are indexed separately.
- Indexers should be idempotent and re-org aware, and state changes should be append-only for auditability.