Bitcoin Exchange Source Code – Module Use Cases

The source code of our cryptocurrency exchange software is based on five different modules.
To better understand how these modules work, let’s take a look at three examples of the modules in action.

1. Trading

A trader places a market buy order. This is the sequence behind the scenes:

1. cxClient receives the buy order (user input) on the frontend side.

2. cxServer retrieves the user input from the cxClient and writes the buy order into the database cluster.

3. The cxEngine pulls the newly written data from the database cluster, checks with the cxWallet if the user has enough capital for the trade and subsequently matches the buy order with a sell order from another user and executes the trade by writing the matching orders into the database cluster.

4. The cxWallet pulls the data written by the cxEngine and changes the wallet balances accordingly. The change of balances is also written into the database cluster.

2. Deposit

a) Deposit FIAT currency

A trader wants to deposit 10 000 Euros into his exchange account. Before he can do that, the exchange operator is required to setup his bank account information in the cxAdmin properly. The cxAdmin writes the exchange operator’s bank information into the database. This is the sequence that follows:

  1. The trader places a deposit request in the frontend of his user account. The frontend is the cxClient.
  2. The cxServer receives the information from the cxClient and retrieves the exchange operator’s bank information from the database cluster.
  3. The cxClient receives the exchange operator’s bank information from the cxServer and displays it to the trader (enduser).
  4. The trader can now send the 10 000 Euro from his bank account to the exchange operator’s bank account.
  5. After the 10 000 Euros arrive in the exchange operator’s account, the exchange operator needs to credit that amount to the trader’s account. The crediting takes place within the cxAdmin module which writes the information into the database cluster.
  6. The cxServer retrieves the information written by the cxAdmin and forwards it to the cxClient.
  7. The cxClient displays the new balance in the trader’s user account.

b) Deposit cryptocurrency

A trader wants to deposit 10 Bitcoin into his exchange account. This is the sequence behind the scenes.

  1. The trader places a deposit request in the frontend of his user account. The frontend is the cxClient.
  2. The cxServer receives the information from the cxClient and sends a command to the cxWallet which generates a public address and writes it into the database cluster.
  3. The cxWallet sends the public address to the cxServer which subsequently forwards it to the cxClient.
  4. The public address is displayed within the browser (cxClient) and the trader can proceed with the transaction.

3. Withdrawal

a) Withdraw FIAT currency

A trader wants to withdraw 10 000 Euros from his exchange account. This is the sequence behind the scenes:

  1. The trader places a withdrawal request in the frontend of his user account. The frontend is the cxClient.
  2. The cxServer receives the information from the cxClient and issues a withdrawal request to the database cluster.
  3. The cxAdmin receives the withdrawal request through the database cluster and the admin can approve or decline the withdrawal request.
  4. If the withdrawal request is approved by the admin, the cxAdmin will change the trader’s account balance in the database cluster.
  5. The cxServer retrieves the information written by the cxAdmin and forwards it to the cxClient.
  6. The cxClient displays the new balance in the trader’s user account.

b) Withdraw cryptocurrency

  1. The trader places a withdrawal request in the frontend of his user account. The frontend is the cxClient.
  2. The cxServer receives the information from the cxClient and issues a withdrawal request to the database cluster.
  3. The cxWallet automatically reviews the withdrawal request and approves or declines it.
  4. If the withdrawal request is approved, the cxWallet will send the requested amount to the trader and record that information in the database cluster.
  5. The cxServer retrieves the information written by the cxWallet and forwards it to the cxClient.
  6. The cxClient displays the new balance in the trader’s user account.

Withdrawal limits and transaction fees can be configured within the cxAdmin.