The Trader is an application that simulates trading stock items for companies. Users provided stock items they want to sell, others indicate they want to buy stock items. If you want to learn more about the possibilities of the application please go to the User guide.
This page describes the different Entities of the application:
Company – Is the entity that can make stock items available. They also give the indication for the value of stock items when they hit the market.
Portfolio – Is the entity that contains money and stock items. Using a portfolio a user can start a Buy transaction or a sell transaction. The portfolio also has the responsibility to reserve money for buy orders and reserve stock items for sell orders. The portfolio has a reference to the User.
Transaction – The entity maintaining the state of an order. Using the transaction, the systems knows whether an order is accepted, cancelled, executed or maybe partially executed. The transaction has a reference to the OrderBook the Buy or Sell transaction was created for. The transaction also has a reference to the Portfolio the that started the transaction.
OrderBook – Entity controlling the match making between buy and sell orders. An OrderBook entity maintains the list of buy orders and sell orders. When new orders arrive, the OrderBook stores them and checks if there is a match between the new order and one or multiple other orders. An OrderBook is related to a Company and represents one type of stock item.
Order – Entity object containing the data required to do the match making of orders for a certain stock item. Each order has a reference to the transaction the order was created by.
Users – Entities representing the users of the system.
The diagram below gives an idea of the relations between the different entities.