Research
Refactoring
- Clean up the current code. Use an AI and ask questions like: "Can this code be simplified without changing it's functionality", "can you spot any bugs in this code?", "can this code be made more efficient without making it harder to read". At this point the focus should be on readability, not speed. It's always good to upload the PDF with any questions to the AI.
- Re-name variables to align to the PDF
- Rename the existing forms to "Buy Limit Order" and "Sell Limit Order"
Implementation
- Add tests to the existing code
Buy Market Order
- Create a form with a field for amount and a button "Buy"
- Create test cases for the process described in the next item
- When the button is clicked and the amount is 100, we search the order book (called eatBook in the PDF) starting from the best (lowest) price until we have found the maximal number of orders <100. Lets say we found 3 orders totaling 60. We call the function that would get called if the user clicked the three buttons themselves.
- Show a modal window informing the user that they bought 60 tokens.
Sell Market Order
- Similar to above but requires one more message (todo)
Delete Orders
We have to make sure that after/when an order is matched, it's object is deleted, so that we only have to sync against active orders
Push Notifications
We have to use computer.subscribe to get push notifications about updates to the order book
Add Charts
- Add "Market Depth" Graph
- Add "Price Chart" using the new function "computer.getTXOs"
Research
Refactoring
Implementation
Buy Market Order
Sell Market Order
Delete Orders
We have to make sure that after/when an order is matched, it's object is deleted, so that we only have to sync against active orders
Push Notifications
We have to use
computer.subscribeto get push notifications about updates to the order bookAdd Charts