Chapter 5. Containerized Trade Stock API
With a new AvailableTrade brokerage account open and funded, your investment customer is ready to start trading on your AvailableTrade application. Now you’ll deploy the Trade Stock API that processes trade orders to buy or sell stocks. As with the Account Open API, the business owners of the AvailableTrade platform have requested an RPO of one hour and an RTO of four hours for the Trade Stock API. In addition, they have asked for a service-level agreement (SLA) specific to a trade latency of under 200 milliseconds from the point a request is received. The SLA does not include client-side processing or transmission over the internet, as those are both out of your control. Because stock prices change constantly during trading hours when the stock market is open, trades are executed at the bid/ask price at the time they are received by the brokerage. There can be minor fluctuations from the value the customer sees on the UI when they submit a trade until the time the trade is matched. The Trade Stock API is synchronous, so the frontend can report errors or transaction timeouts immediately back to the customer, so they are quickly aware if their trade was accepted or not.
To achieve these business requirements, this service first places an order with a third-party brokerage which will then confirm the trade and orchestrate matching and clearing with the National Securities Clearing Corporation (NSCC). To complete the trade, the service will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access