The exchange app that we're going to build needs to perform the following functions:
- Keep a track of the Gold and USD token balance for the user.
- Allow the user to view orders on the orderbook contract.
- Update the orderbook in real time by listening to any buy/sell/trade events that are triggered by the orderbook smart contract.
- Allow the user to submit buy and sell requests.
- Match the buy/sell requests against existing orders in the orderbook if matching orders are available.
- If no matching orders are available, submit a new buy/sell order to the orderbook.
Alright, now let's start building our app. This section assumes basic-to-intermediate knowledge of React.js from the user. The entire React interface can be downloaded from the GitHub repository as follows:
https://github.com/PacktPublishing/Blockchain-Development-for-Finance-Projects...