Allocate And Release Brokerage Inventory
Reserve shares from brokerage inventory for a client market buy, then release that reservation when the exchange fills or rejects the order.
A brokerage desk moves shares between a client, the brokerage inventory, and an exchange.
For this exercise, assume a client market buy first reserves shares from the brokerage inventory for that client and symbol. For this exercise, assume a later exchange fill releases the reservation into the client's holding, and an exchange reject returns the reserved shares to available inventory.
For this exercise, assume available, reserved, and filled client holdings for a symbol sum to its fixed initial inventory; none may be negative. For this exercise, assume only market buy and the matching fill or reject are in scope; limit orders, shorts, and a public order book are out of scope.
For this exercise, assume authentication, live market data, and settlement netting are out of scope. For this exercise, assume one in-memory process owns inventory and reservations; durable replication and multi-region failover are out of scope.
For this exercise, assume a missing symbol or an oversize reserve is rejected without changing inventory. For this exercise, assume a concrete walkthrough reserves 10 shares of one symbol, the exchange fills those 10 shares, and available inventory drops only for the reserved quantity.
For this exercise, assume a focused follow-up will ask how reserve and release stay correct if they overlap on the same symbol.
Design the objects, public contracts, and collaborations that support reservation and release. Do not start from a stock brokerage class list.