Spartan Trader - part 5 (H17)

Executing transactions: stocks and options

Goal

By completing this homework you will have implemented a manual stock and option trader workstation (the "Spartan Trader") that communicates with a remote exchange ("Athens") to execute trades.


Context

source:memegenerator.net

"Dearest, I hope this digital correspondence finds you in the best of health and spirits. I am writing to inform you of my forthcoming absence from work as I venture on an OPULENT sojourn to the Amalfi coast. It shall be a well-earned hiatus from the rigors of my executive duties, which will allow me to savor the rejuvenating fruits of a RESPLENDENT locale. Ta-ta!"
Ms. Tickertracker has gone on vacation.  Maybe you can take advantage of her absence and complete the trading functionality to the Spartan Trader before she gives you more requirements.
"I am on it, Boss" sigh you, thinking that if you complete the job quickly, you might even find time to start planning your own next vacation.


Requirements

Executing trades means to us posting a record that represents a trade to a transaction queue in a remote database.  A transaction queue is an append-only table, meaning that it accepts inserts from all Teams, but does not let you update or delete them. Trades are irreversible. One you made them, you cannot take them back.
This installment of the Spartan Trader builds the full functionality for executing stock and option transactions and adds a few preview metrics. The homework

  • is cumulative, which means that it needs to do everything that the previous homework did
  • submits correct transactions (Buy, Sell, SellShort, CashDiv) for stocks to the Athens databases  (alpha, beta and gamma)
  • submits correct transactions (Buy, Sell, SellShort, X-Put and X-Call) for options to the Athens database chosen by the user

To help you out with the typing, please find some of the code necessary to complete this assignment