Introducing the distributed currency trading exchange

Blockchains are facilitating much more transparent, faster, and efficient cross-border remittance transactions. This is due to the much faster reconciliation that the technology offers when compared to traditional payment systems. However, cross-border transactions are incomplete without cross-currency transactions.

Cross-currency transactions convert the starting or initiating currency of a cross-border remittance into a different currency, suited to the beneficiary receiving the remittance transaction. Thus, if an importer in India is paying an exporter in Germany, they may initiate the transaction in INR but may want the exporter to be paid in EUR. In traditional remittance transactions, the remittance enablers—that is, the remittance exchanges or banks themselves—provide an exchange rate to the remittor. This rate is, typically, a bit higher than the network. If I choose a specific remittance exchange or bank for my remittance transaction, I'm married to the exchange rate provided by them. 

Distributed payment networks go a bit further than the traditional remittance models. They provide a transparent exchange, whereby any market maker can post their exchange rates. The user can then choose the best rate suitable for their transaction. All the buy-and-sell offers for a currency pair are recorded in a single platform, called an orderbook. Each currency trading pair has a unique orderbook. While facilitating a transaction, the user can choose their starting and destination assets, and the network will automatically choose the best rates from these exchanges and facilitate the transaction for them. Alternatively, these exchanges can also be used as trading exchanges, to buy and sell currency.

Each currency offer being submitted to the trading exchange has a base asset and a counter asset. The price of buying or selling a single unit is represented using the base asset. The amount to be bought or sold in a single offer is represented using the counter asset. Each asset is issued by an issuer account. This is simply an account that creates an asset on the network. To hold, send, and trade an asset, accounts need to extend a trustline. A trustline indicates how much of the asset they are willing to hold. It allows a user of the asset to declare how liquid they believe the issuer of the asset is, and then hold a proportional amount of the asset in their Stellar accounts. In simple terms, if you want to hold 100 USD in your account, the issuing account of the USD asset needs to extend a trustline of 100 USD to your account. If someone tries to transfer 101 USD to your account, the network will throw an error. Since assets on Stellar are a virtual representation of physical fiat currency, the trustline concept is important. 

To build our market maker, we need to complete the following steps:

  1. Create a private test Stellar network with the Stellar Core blockchain node and Horizon client/server that will allow us to interact with the blockchain node.
  2. Create three test accounts. One is an issuing account, while the other two are receiving accounts. The issuing account will issue our trading assets, while the receiving account will trade them on the exchange.
  3. Issue USD, GBP, and EUR assets on our private Stellar network using our issuing account.
  1. Extend trustlines and transfer a "testing" amount of the assets to our receiving/trading accounts. 
  2. Build a frontend that will allow the trading user to log in with their account, view the available offers, and submit buy/sell offers. These offers will be recorded on the in-built distributed exchange that the Stellar network provides to us. The frontend will also show us successful trades.

 The exchange would have the following components: 

  • The assets USD, GBP, and EUR, which are issued on a private Stellar network.
  • Two user accounts that will act as market makers and hold the preceding currency.
  • A trading exchange that connects to Stellar fetches offers for each trading currency pair and displays them to the user, accepts offers from the user, and displays the completed trades.

Let's start going through the steps, one by one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.64.128