PaperDesk
A multi-service paper exchange for spot and USD-margined perpetuals.
Overview
PaperDesk is a multi-service paper exchange for spot and USD-margined perpetuals. It is built to show the path after Buy: a single-writer matching engine, an OMS with a Postgres outbox, a gateway over Redis Streams and SSE, and a separate Timescale writer for history. Balances are paper money. The point of the project is durable order flow, reconnects, and crash windows that a single CRUD API usually hides.
Highlights
- Spot + perpetual markets
- Single-writer matching engine
- WAL and snapshot recovery
- OMS outbox over Redis Streams
- SSE reconnect with catch-up
- Margin, mark, liquidation, funding
- Timescale market history
- Grafana ops dashboard

Built with TypeScript, Node.js, React, Next.js, Hono, SSE, Redis Streams, Redis Pub/Sub, PostgreSQL, Prisma, TimescaleDB, Prometheus, Grafana, Loki, Docker, pm2, nginx, GitHub Actions
