Design a customer-facing market surveillance platform for financial exchanges.
Financial exchanges submit trading orders to the platform. An example order is: trader T4 places an order to buy 1 BTC at 30,000 USD.
The platform must identify potential market manipulation activity. Detection is performed by pre-built algorithms that consume incoming orders and asynchronously generate suspected manipulation events with related metadata, such as orders, traders, exchanges, timestamps, and reason codes.
There are two detection algorithms:
-
Trader-keyed algorithm
: every order for a given trader must be processed by the same algorithm instance.
-
Exchange-keyed algorithm
: every order from a given exchange must be routed to a single algorithm instance responsible for that exchange.
Additional constraints:
-
Trader identifiers are globally unique across all exchanges.
-
Each algorithm can be independently replicated and deployed.
-
Each algorithm instance may process multiple traders or exchanges, depending on throughput capacity.
-
You do not need to design the internal detection algorithms.
-
The system must handle high QPS.
-
The design should consider availability, reliability, durability, and scalability.
Design the end-to-end system, including APIs, ingestion, routing, storage, asynchronous processing, failure handling, and how suspected manipulation events are exposed to customers.