System Flow
Core Services
Data Layer
NATS JetStream:- Event streaming backbone
- Guarantees event ordering
- Enables replay for recovery
- Scales horizontally
- Fast user state cache
- Sub-millisecond access
- Recent trader data
- Time-series analytics
- Historical trade data
- User balance history
- Market statistics
- Periodic state backups
- Fast recovery
- Every 5 seconds
How a Bundle Flows Through the System
1. Submission (t=0ms)Why This Architecture?
Event-driven design:- Everything is an event (auditable, replayable)
- Services can scale independently
- Natural disaster recovery via event replay
- Fair competition (no speed advantage)
- Efficient resource usage
- Predictable latency
- Each service has one job
- Easy to understand and maintain
- Can optimize independently
Auction Timing
The Sequencer is the heartbeat of Likely:- Detects every 500ms boundary
- Emits
AuctionOpenevents - Emits
AuctionCloseevents - Ensures deterministic batch IDs
Privacy by Design
Bundle privacy:- Bundles don’t expose trader identity
- Only you see your bundle details
- Market sees aggregated orderbook
- Dispatcher filters events by user
- Private data goes only to you
- Public data (orderbooks, auction state) broadcast to all
Next Steps
- Understand Matching Engine execution
- Learn about Batch Auctions timing
- Explore OrderBook matching