Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Post-Trade Booking and Settlement Pipeline

Book every stock trade exactly once, match it against broker records, raise breaks, and get agreed trades instructed and settled with audited corrections.

Problem statement

Design the post-trade pipeline that takes a trading firm's stock trades from the moment they are executed to the moment they are settled, and that catches problems early enough for operations staff to fix them.

For this exercise, assume the firm trades listed stocks in one currency through about 20 executing brokers. The firm's own order system reports each fill as it happens.

Each broker separately sends a drop copy of the same fill within a few seconds, and later the same day a confirmation that states the trade's final details. Every trade settles one business day after the trade date through a single custodian, which holds the firm's shares and cash.

The firm sends the custodian one settlement instruction per trade, and the custodian reports whether each instruction is matched, settled, or failed.

A trade must be booked to exactly one account exactly once, even when a feed resends or drops messages. A booked trade is never edited in place: a correction cancels it and books a replacement, and both stay in the audit history.

A trade is sent for settlement only after the firm's record, the broker's drop copy, and the broker's confirmation agree, unless an operator releases it with a second person's approval. Any disagreement or missing record becomes a break that someone owns until it is resolved.

Out of scope: placing or routing orders, pricing and profit reporting, regulatory reporting, netting several trades into one instruction, and other asset classes or currencies.

What to build

  1. Every fill from the order system is booked exactly once to one account, and the account's position changes by exactly that trade, even when a feed resends or drops messages.
  2. Each booked trade is compared with the broker's drop copy and confirmation; a missing record or a mismatch in side, quantity, price, account, or settlement date becomes a break with an owner and a deadline.
  3. Agreed trades produce a settlement instruction to the custodian before the daily cutoff, and the firm tracks each instruction until the custodian reports it settled or failed.
  4. Operators can amend or cancel trades through audited, approved corrections, and every day the firm's positions and cash are reconciled against the custodian's statement.

At scale

  • For this exercise, assume about 2 million fills a day, with peaks of about 5,000 fills a second at the market open and close, and the same volume again from broker drop copies.
  • For this exercise, assume a booked fill must show in the account's position within 1 second, because traders and risk checks read positions during the day.
  • For this exercise, assume a missing or mismatched record must appear as a break within 5 minutes of the evidence that creates it, and every trade must be agreed or escalated before the 6 p.m. instruction cutoff on its trade date.
  • For this exercise, assume no fill may be lost or booked twice, and every trade, correction, and break decision is kept for 7 years for audit.