Skip to main content

Monaco Protocol v0.5.1

Note: These are historical release notes for v0.5.1 and describe the architecture as it shipped at that time. Redis (and its ElastiCache deployment) has since been removed. The current architecture is PostgreSQL (durable source of truth) + NATS JetStream (durable log and pub/sub fan-out) + an in-memory matching engine (DashMap). References to Redis below reflect the v0.5.1 design only.

Architecture Evolution

This release marks a significant evolution in Monaco’s infrastructure, transitioning from a monolithic API to a distributed microservices architecture designed for high-frequency trading workloads.

High-Level Architecture

Microservices Breakdown

Path-Based Routing

All services are accessible through a single domain with intelligent path-based routing:

Performance Architecture

The Monaco Speed Layer

Monaco achieves sub-millisecond order processing through a carefully designed dual-storage architecture:
Key Innovation: Our proprietary Redis layer handles all balance operations with custom atomic scripts that ensure consistency while maintaining sub-millisecond latency. This allows us to process the entire order lifecycle—from balance validation to trade settlement—without waiting for database round-trips.

Latency Targets


Real-Time Data Streaming

WebSocket Architecture

The dedicated WebSocket service provides real-time market data with minimal latency:
Available Channels:
  • orderbook:{trading_pair_id} - Real-time orderbook updates
  • trades:{trading_pair_id} - Trade executions
  • user:{user_id} - Private order updates

gRPC API (New)

Why gRPC?

Quick Start

Service Reference


Deployment Architecture

Container Orchestration

Each microservice runs as an independent ECS service with auto-scaling:

Horizontal Scaling

  • Stateless APIs: HTTP, WebSocket, and gRPC services scale horizontally
  • Matching Engine: Partitioned by quote token for parallel processing
  • Redis: ElastiCache cluster with read replicas
  • PostgreSQL: RDS with read replicas for query scaling

Migration Guide

From v0.5.0

No breaking changes. The REST API remains fully compatible. New services are additive:
  1. WebSocket: Now on dedicated service (improved reliability)
  2. gRPC: New option for latency-sensitive applications

Choosing Your API


What’s Next

  • Streaming gRPC: Server-side streaming for real-time data
  • FIX Protocol: Industry-standard trading protocol support
  • Colocation: Reduced latency for institutional traders

For detailed API documentation, see the REST API or WebSocket API sections.