TKEY Online. Part Three: The Exchange

Introduction

The professional market has been created for centuries, and the cryptocurrency market is still very young, so we are witnessing various stories of both the success and the fall of a particular digital token. History is cyclical. This is why the digital currency market may resemble the times of the Amsterdam Stock Exchange and the IPOs held at that time.

Reference. In 1611, the East India Company was renamed the Amsterdam Exchange.

At that time, the market lacked a strict system for regulating the placement of shares, which allowed fraudulent IPOs to be conducted. The peak of such events occurs in the XVIII century, when funds were raised for the creation of a “perpetual motion machine,” for the “relocation of tropical monkeys” or in general for a “very profitable enterprise.”

In the cryptocurrency industry, such years fall on 2017–2020, thousands of projects with “flights to the moon” or the release of a token for something, and for what it is unknown. And not so much time has passed, the market is developing, becoming stronger, but the competition in such a market is quite weak. This can be traced to the level of service, the speed of development of tools, there is simply no real struggle for the consumer. Besides, the problem is not only for the business, but also for the consumer. When preference is given to absurd things, in the style of “digital bread” or “digital socks.” However, people invest their money and support such areas, thereby weakening the competitive ability of the business.

Looking at the business relaxes, there is no longer any need to create high-quality tools, build business processes, when “digital socks” are successfully sold. Plus, the events of the past years are a complete fraud. Due to this history, it is more difficult for the market and its real representatives to develop when investments fixate on assets or systems that should be useless a priori.

Of course, if we draw a parallel with the development of the distributed network technology itself and the blockchain in the development market is much more successful than that of the cryptocurrency trading market itself. Back in 2010, when Bitcoin appeared, no one could imagine a blockchain without a cryptocurrency. There were no software and application options; there was no documentation, so we saw the first manifestation of blockchain technologies in Bitcoin because it was created precisely as a “cryptocurrency.” Of course, the concepts, ideas, and motives are excellent, and the community has done its job further, so the conception is already significantly different from the initial philosophy.

And as you have already understood from the introduction, the market needs infrastructure, reliable products, and the proper level of service. The purpose of the introduction is to draw the attention of market participants to the creations of high-quality business processes, and consumers to forming necessary needs, rather than following imposed trends, in the style of “comical” assets. In general, all the subsequent material about the exchange, testing, launch time, briefly about the architecture, etc. Let’s get started!

Exchange infrastructure

The base function of the exchange is to accept orders to buy/sell various trading instruments and to combine orders into a deal. Trading instruments is an asset that has a price set and can be bought or sold; for example, dollars, the barrel of oil, gold, stock, etc.

In other words, the exchange provides you with tools so that you can easily buy or sell the asset you need at a fair price you. Besides, so that you can receive this asset, and subsequently withdraw it to a bank or other account.

The exchange is not the last place in the TKEY ecosystem. The entire exchange infrastructure is involved in maintaining the ecosystem’s business processes, including international and local transfers, cross-transactions, and payments at retail outlets. All the necessary functions were laid down at the ecosystem level so that in the future the development team could focus on creating various applications and do it quickly. The system elements are easily integrated into any type of service and application, so our developers and third-party developers can implement the necessary trading or payment functions in any type of application. To get an idea of the work of the exchange, let’s analyze the main tasks.

The tasks of the exchange divide into several processes: matching, clearing, and risk management.

Matching system (trading engine) It is responsible for matching buy/sell orders, thereby bringing together the orders of the seller and the buyer in the order book.

Clearing system — making settlements based on the results of transactions and crediting assets (fin. result) to the user’s account.

Risk management refers to the real-time verification of applications according to the relevant parameters: the correctness of the application, the availability of funds for the execution of the order, etc.

The TKEY exchange

Gateways

The TKEY Exchange does not store funds and personal data of users on servers. This ensures a reliable level of security and privacy when using the exchange infrastructure.

Access is provided using a secret key, which is encrypted and stored in a secure storage on the user’s side during the session. After exiting the app, the key is deleted from the storage.

Decentralized architecture

Exchange risks represent the risk of losses from exchange transactions. These risks include the risk of non-payment on commercial transactions, the risk of non-payment of commission fees of a brokerage firm, etc.

The register records the amounts of debt with assets presented as debt obligations, regardless of the type of asset: dollars, precious metals, oil, etc. All accounts and transactions are cryptographically secure and verified algorithmically. Payments can only be authorized by the account holder, and all payments are processed automatically, without any third parties or intermediaries. When information is added to a TkeyRegister, the integrity of the previous data is confirmed by the TkeyNet system and its participants directly.

Simplified scheme of interaction between the TKEY Online gateway and the TKEY ecosystem

TkeyNet provides fast clearing and settlement, defined by the instant transfer of ownership rights from one owner to another. Reconciliation is carried out in a continuous mode, thanks to a distributed registry that updates each transaction. Calculations of this level can significantly reduce the risks of counterparties. Investors benefit from the rapid release of capital that is normally held for centralized clearing.

The exchange, using a distributed system, checks the availability of assets, confirms transactions, checks their compliance, registers transactions in an automatic, unchangeable form, and does it instantly.

Increased transparency is particularly effective because it reflects a clear record of beneficial ownership of the asset, and ensures that it is correct at all times. Besides, by working with various assets, such as shares, transparency creates the necessary traceability to obtain relevant information to other registries, such as shareholder registries, etc.

Understanding the components of an exchange

For Example, the Market Data System. After the purchase order entry, the trade transaction takes place. Information about the price and volume of the transaction is sent to the Market Data System of the exchange, which subsequently distributes this information through the gateway to bidders and companies engaged in market data. For example, you can deploy a separate API to provide market data for an exchange.

The Clearing System. All data on the transactions made is to the exchange’s Clearing System. The system stores the executed trades of the bidders and calculates the balance.

Back-up and Replication Systems. Such systems are responsible for the reliability of data storage, their safety, and the avoidance of data loss in the event of failures on a centralized exchange.

The number of systems that use the exchanges is much larger than it was listed, but the description of the characteristics of each component can take several materials in volume, such as this. Besides, so that you have an understanding of how it works — all the components, including those listed above and in the material below, are already included in the TkeyNet system. The core of TkeyNet is developed based on the low-level C language, and for working with complex data types, some libraries are written in C++.

Thus, given that all components in the ecosystem are a single organism, we can say that the exchange is written in C and C ++, and all systems are connected to it via TkeyNet, forming a single system.

Further, the material will discuss orders, priorities for their execution, liquidity, and the impact of cross-currency transactions on the entire system as a whole.

Matching Engine

Matching Engine (The TKEY Exchange).

How does it work? An investor wants to buy a certain amount of assets and sends a buy order, another investor tries to sell the same amount of an asset at a similar price, he sends a sell order — the orders of both investors are the same and the transaction is processed.

Matching orders is one of the main functions that is required for trading. Bid matching occurs when compatible bids to buy and sell the same asset are submitted near price and time. Fast, and most importantly, accurate order matching is a critical component of any exchange.

Let’s look at the example of market and limit orders.

Market orders give priority to order execution for the specified amount, completely ignoring the price. The order has priority in the “Book of Orders” and guarantees execution with sufficient liquidity in the market. A market order is only limited by the volume of assets that you want to sell/buy.

Example. You place an order to buy 1 BTC, it can be executed at the price that is set in the current sell orders, for example, at 49,000, 49,100, or 50,000.

In other words, a Market Order will be executed at the price of the existing order and in the quantity that is available at that price.

Limit orders allow you to create an order with a specific price that will be executed or at a better price. Buy. For a limit buy order, the limit price is equal to or higher than the sell price. Sell. For a limit sell order, the limit price is equal to or lower than the offer.

Thus, if an order is not a “market order,” it is stored in the “Book of Orders” until it is used by another order, or is involved in a cross-payment/deal, or is canceled by the order creator altogether.

Priorities for order execution

Note. First of all, orders are executed based on the price criterion. Bids that were placed at the same price and were created earlier have priority over bids that were created later with the same price.

The matching engines have unique high-performance algorithms that provide high throughput and high availability.

In addition to execution priorities, attention should be paid to the speed of order execution. An important component in the infrastructure of the exchange will be market makers and cross-currency transactions.

Market makers and cross-currency transactions

Technical. At the system level, a scalable architecture has been created, a powerful engine capable of processing a huge number of transactions without delays for market participants.

On a technical level — processing speed is achieved by the TkeyNet infrastructure, which is part of the ecosystem. The system processes up to 8.640 million transactions per day, besides, mechanisms have been introduced to increase this indicator. As you understand, in technical terms, everything is prepared and fully adjusted by the development team.

Economic. Liquidity is the property of assets to be quickly sold at a price close to the market price.

In the material “TKEY Online. The second part,” the team mentioned about the main role of market makers, which is to eliminate the lack of liquidity, which will make trading available to everyone.

Reference. On trading exchanges, the price constantly fluctuates, the change can be measured in decimal fractions, and in order to compare orders for buying and selling in a certain range, a market maker is needed that connects buyers and sellers. Due to this, it is easy to buy or sell at the same second of creating an order.

In the interests of business development and providing quality trade — the TKEY team is working on three main areas:

  1. Attracting partners who will join the system as market makers.

2. Development of flagship IT products, for example, TkeyPay for a wide range of consumers.

3. Conducting marketing campaigns.

Let’s start in order with attracting partners as market makers. Partners are business companies, fintech companies, payment systems, and financial institutions that are interested in making a profit and are willing to work with large volumes.

To maintain the exchange infrastructure and to make a profit, any participant in the system can become a market maker, thereby speeding up the execution of orders on the exchange and making money. For this purpose, a robot market-maker is being created so that you can directly influence the level of liquidity.

The actions of market makers, regardless of whether they are a large-partner or a user, form a single liquidity system. Each participant complements each other, especially since everyone is interested in profit, which is the motivator.

Development of flagship IT products. Of course, the development of application functionality will attract a range of interested parties.

Above there was a mention of cross-currency transactions, let’s see how they affect trade, what is meant by this term, and how it is related to the flagship IT products.

In simple words, cross-currency transactions are the ability to send or receive an asset that you do not own but want to receive, while winning on currency conversion.

How does it work? Let’s analyze an example for a better understanding.

Alice’s task. Alice understands the value of money, and knows how to save it. She wants to send money to Bob, who lives in Dubai. However, Alice only has dollars, and Bob needs dirhams.

Alice’s discretion. Alice adheres to the principle of economy, speed, and quick availability. She understands that if she uses an exchange service now, she will need: first, time to search for the service, second, to take into account the transfer fee, third, time to make an international transfer, and fourth, time to process the money transfer, which will be executed within 2–3 days.

Alice’s solution. Alice uses the TkeyPay app. Opens the app → specifies Bob’s TkeyID or other identifier, such as a phone number → specifies the amount in dollars and selects the receiving currency: dirham → clicks send → Bob gets dirhams.

Cross-currency transactions

Results. Alice, having only dollars available, sent Bob dirhams to the UAE in several seconds without any commissions and fees.

Impact of cross-currency transactions on exchange transactions

Example. Various assets are available on the TKEY exchange, but the USD/AED pair has a minimum liquidity pool or does not exist at all. As mentioned in the example above, Alice needs to send dirhams to Bob, but she only has rubles. What happens when you create a cross-currency transaction and how does it work?

Chains of cross-currency transactions can be short or long, it all depends on the initial and final asset. The task of such an operation is to exchange illiquid assets among themselves while saving on conversions and exchanges.

Let’s analyze a short chain of cross-currency transactions. There is a Bank that provides the liquidity of the TKEY/AED trading pair in both directions. When Alice clicks “Send” in the app, the system signals to TkeyNet and the protocol processes the transaction, finding the best exchange path on the exchange:

USD/TKEY → TKEY/AED and conducts the crediting to Bob in the AED. The entire transaction is executed within several seconds.

To make it even easier to understand, let’s look at this example from the point of view of different participants. You are a trader at the time of Alice’s cross-currency operation, you have created a sell order for TKEY or AED, your order will be executed for the operation that is required for the transfer to Bob.

Longer chains may look like this: GBP / EUR → EUR / USD → USD/BTC → BTC/ETH or TKEY/USD → USD/BTC → BTC/ZAR. The length of the chain depends on the initial currency that you send and the currency of the recipient, and, accordingly, the level of liquidity between them.

Cross-currency transactions

Reference. The asset is converted to the recipient’s currency by searching for the best exchange path, using exchange rates on a decentralized exchange or through a market maker.

The advantage for companies and users is obvious, because for multi-currency payments and transfers abroad, you can use the local currency. There are no currency risks, each of the parties will receive the currency that is required, and there are no additional fees and commissions.

Note. The TkeyNet protocol checks balances and accounts within the system to transfer payments, and sends payment notifications with minimal delay, ensuring fast payments in the system.

Highly liquid market

Imagine that: thousands of users use TKEY’s applications, make transfers in various currencies. At this moment all these operations pass through the exchange, thereby providing assets with liquidity.

Add to this the third-party applications that are integrated into the system via the SDK and TkeyAPI — there are still dozens, hundreds of users. One of the advantages is the creations of financial applications by third-party companies that use the capabilities of the TKEY ecosystem. The volume of liquidity and transactions will grow with each new application released. As a result, the market is provided with active traders and third-party users connected to the system through other applications.

For example, the user uses the application of one of the fintech companies connected to the ecosystem. It makes payments abroad, at a low level, all operations are carried out thanks to TkeyNet, and the application user may not even know about it.

Let’s simplify the diagram. There is a Sender side. There is a Recipient side. When the Sender owns currency X, and the Recipient needs currency Z — all iterations go through TkeyNet, the order is executed on the exchange, thus, such cross-currency transactions cover the needs of three parties: the Sender, the Recipient, and the participants in the trading market — the TKEY Exchange.

The ecosystem creates a large-scale market — the participants, which may not be personally connected, but are technically connected, which positively affects trading operations.

Completing testing, integrating, and launching TKEY Online

In early March, the process of testing the trading functions and their interaction with the entire ecosystem was completed, then the process of working integration with partners began. The integration period will take plus or minus a month, after which the application will be released and trading will begin.

On March 31, we published a presentation of the TKEY ecosystem in Russian, shortly, specialists will adapt it for the English-speaking audience, and we will publish it on the ecosystem website.

After the release of TKEY Online, the stage of strategic development of the TKEY ecosystem and its main products will begin. You, as users of the system, can indirectly participate in this, for example, connect as market makers, etc.

As mentioned in the article, all participants of the system, regardless of whether they are companies or private investors, contribute, because they are interested in making a profit.

Therefore, in the course of the next launch, we hope that you have read the material, understood the main meanings of trading operations and the principles of the market.

If you still have questions, please send them to support@tkey.org or ask them to the administrators of the official channels in social networks. That’s all for today.

Thank you for your attention, stay tuned!

Official TKEY blog in Medium. Infrastructure for the financial ecosystem