back to home

opinion trading

#javascript#express#redis#websocket#prisma#postgresql#jest#bun

event-based opinion trading platform backend with in-memory order book and real-time websocket updates.

backend for an opinion/event trading platform similar to probo or polymarket. users trade yes/no shares on event outcomes with a full in-memory order book and matching engine. uses a task queue pattern — express api pushes tasks to redis, a worker processes them against in-memory state, and results are published back via pub/sub. includes real-time websocket updates so clients get live order book changes. supports user management, inr on-ramp, order placement, minting, and balance queries.

/ features

order book engine
full matching engine for yes/no shares with price levels summing to 10. handles buy/sell matching and order reversal.
task queue architecture
redis-backed task queue with pub/sub for decoupled api and worker processing.
real-time updates
websocket server pushes live order book changes to subscribed clients per symbol.
user & balance management
user creation, inr on-ramp, stock minting, and balance/locked tracking.