Coin exchange

From ArdorDocs
Jump to: navigation, search
This page contains changes which are not marked for translation.
Other languages:

Description

This page covers the decentralized coin exchange within the Ardor multichain platform. This feature allows trading all chain tokens on the Ardor blockchain by using buy and sell orders and a built-in matching engine. For instance, the coin exchange allows trading ARDR for IGNIS and IGNIS for ARDR.


Accessing the Coin Exchange

To access the coin exchange, you need to install the Ardor client, check out the getting started page or the common problems and resolutions page in case you are having problems.


The Interface

With the server running, access the Ardor interface of your client by visiting http://localhost:27876/ (or https://localhost:27876/ if you have enabled SSL). The 26876 port is for the Tesnet while 27876 is for mainnet. On the sidebar, select a chain (e.g.: Ignis), click the menu Coin Exchange, this will give you access to the following options:

CoinExchange.png
Coin Exchange: This tab gives you access to the Coin Exchange itself. To select a coin to be traded of, click on the right one of the chains to be exchanged (e.g.: ARDR, BITS, GPS...). By selecting a coin, further information is provided such as a description, buy and sell orders, the quantity, and the trade history.
Coin Exchange History: This page will list all the coins traded by your account: both those bought by you and those you sold from the exchange.
My Coin Orders: Here is provided a list of all your orders, notably the coins you are either trying to sell or to buy. It also allows you to cancel them.






Coin Exchange menu

The coin exchange menu is as follows:

Coin Exchange available within the client.
This is the main menu for the Asset Exchange, it is fundamentally organized in two areas.
  • a list with all the coins available.
  • an interface that allows interaction with these coins.
If you own tokens for a coin, it will appear the amount value on the side list.
By selecting a coin, the interface area will automatically display the corresponding information. This includes the amount of coins available ("Total Available"), how divisible is the coin ("Coin Decimals") and the coin name ("Coin Name")
To buy a coin, follow these simple steps:
1. select the coin from the list on the left.
2. Amount: define how many coin tokens you are interested in buying.
3. Rate: set how much you are willing to pay. It refers to the cost of a unit of tokens. So, by entering 10, you are willing to pay 10 of your currently selected chain tokens per coin token to buy.
4. press buy, it will prompt a pop-up window (see figure below)
5. fee: define the fee, see fees in Create Transaction Request or click on the "Calculate" button, which will automatically calculate the current network fee.
6. it will ask you for your passphrase and finally press buy asset.
Confirm Order Buy Coin Exchange.


My Coin Orders menu

Under this menu, you can see all your coin exchange orders that are currently open.

Open orders menu.png

What to keep in mind:

  • You can cancel any order you made. However
    • The process is not instantaneous. Your cancel order is broadcasted to the network, your order may get accepted before you can manage to cancel it.
    • The process of canceling an order is a transaction, meaning it involves a fee of 0.01 Tokens, see: fees.
    • An order in the process of being canceled will appear in red under your My Coin Orders menu.
  • In this image, the sell order I am willing to sell Ignis to Buy ARDR at a rate of 1:1


How to Calculate the Exchange Rate using the API

For example to calculate the chain 3 to IGNIS exchange rate

  • To get the best asking price get the "askNQTPerCoin" attribute from the first result of getCoinExchangeOrders with chain 2 and exchange 3 and convert it to 4 decimals
  • To get the best bid price get the "bidNQTPerCoin" attribute from the first result of getCoinExchangeOrders with chain 3 and exchange 2 and convert it to 4 decimals
  • To get the last trade price get the "exchangeRate" rate attribute from the first result of getCoinExchangeTrades with chain 3 and exchange 2


FAQ

See more: