zachnicoll / trading-platform

Repository for the CAB302 major assessment piece.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverside Trade Resolving

zachnicoll opened this issue · comments

Requirments

  • The server should intermittently check for trades to be resolved (every 30 seconds)
  • After resolving two trades, the status of each trade should be set to 'RESOLVED'
  • All trades that can be resolved should be resolved e.g. there is no limit to number of trades resolved every 30 seconds
  • Organisational Unit asset quantities and credit balances should be checked before resolving trades
  • If there is some slack in two compatible trades (e.g. ‘BUY 10 widgets for 20 credits’ and ‘SELL 10 widgets for 15 credits’) the transaction should be carried out using the lower price (which will always be the selling price.)

Here is multiple methods for scheduling tasks in Java:
https://stackoverflow.com/a/18896316