TKEY Online. Part Three: The Exchange
Tags: Payments, Tkey, Tkeynet, Payment Gateway, Distributed Ledgers

Introduction

The time of trading halls has long passed. Modern exchanges are large IT infrastructures that include a whole range of systems. Just note that cryptocurrency exchanges can differ significantly from exchanges that operate in the classical financial market. There are significant differences both in the IT infrastructure and in the trading models, and the market itself behaves differently.

The professional market has been created for centuries, and the cryptocurrency market is still very young, so we are witnessing various stories of the success and the fall of a particular digital token. History is cyclical; this is why the digital currency market may resemble 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 occurred 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 more robust, but the competition in such a market is relatively 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 the 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, it is much more successful than that of the cryptocurrency trading market. 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, and more. Let’s get started!

Exchange infrastructure

As mentioned at the very beginning of the material, professional exchanges are large-infrastructure. And when creating the entire TKEY ecosystem, the team was guided by the principles of an infrastructure, platform-based approach to achieve positive results in the future.

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

In other words, the exchange provides you with tools to easily buy or sell the asset you need at a fair price you. Besides, 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 service and application, so our developers and third-party developers can implement the necessary trading or payment functions in any 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 seller and buyer orders 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, and more.

The TKEY exchange

Gateways

Applications act as gateways that connect to a decentralized exchange. TKEY Online is a gateway through which the user connects to the exchange infrastructure.

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 secure storage during the session on the user’s side. After exiting the app, the key is deleted from the storage.

Decentralized architecture

The decentralized architecture aims to solve the problems that are inherent in centralized exchanges. Using the distributed system TkeyNet, market participants store funds independently and manage them; the parties do not have exchange risks.

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

The register records the amounts of debt with assets presented as debt obligations, regardless of the type of asset: dollars, precious metals, oil, and more. All accounts and transactions are cryptographically secure and verified algorithmically. The account holder can only authorize payments, 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 usually held for centralized clearing.

The exchange infrastructure 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 and more.

Understanding the components of an exchange

A centralized exchange consists of various systems necessary for implementing specific functions of the exchange and ensuring its smooth operation.

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 more significant 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 understand 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.

Matching Engine

The Matching Engine is the trading core of the exchange. The engine performs the process of executing orders (buying/selling) from various market participants.

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; you can execute it at a price 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 quantity available at that price.

Limit orders allow you to create an order with a specific price that will execute or at a better price. Buy. For a limit buy order, the limit price is equal to or higher than the selling 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 another order uses it, is involved in a cross-payment/deal, or is canceled by the order creator altogether.

Priorities for order execution

Order execution priority: price — time. Bets and bids entered first into the matching system take precedence over similar bids or those subsequently entered into the system.

Note. First of all, orders are executed based on the price criterion. Bids placed at the same price and were created earlier have priority over bids 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, should pay attention to the speed of order execution. An essential component in the infrastructure of the exchange will be market makers and cross-currency transactions.

Market makers and cross-currency transactions

The speed of order execution should consider in several dimensions: technical and economic.

Technical. A scalable architecture has been created at the system level, a powerful engine capable of processing many transactions without delays for market participants.

On a technical level, the TkeyNet infrastructure achieves processing speed, 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 the primary role of market makers, eliminating the lack of liquidity, making trading available to everyone.

Reference. On trading exchanges, the price constantly fluctuates, can measure the change in decimal fractions, and compare orders for buying and selling in a specific range; a market maker is needed to connect buyers and sellers. Due to this, it is easy to buy or sell at the exact second of creating an order.

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

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 interested in making a profit and are willing to work with large volumes.

To maintain the exchange infrastructure and 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.

Whether they are a significant partner or a user, the actions of market makers form a single liquidity system. Each participant complements the 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 relates 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 execute within 2–3 days.

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

Cross-currency transactions

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

Impact of cross-currency transactions on exchange transactions

Now we will analyze cross-currency transactions at the level of the system and the exchange to understand their advantages both for the user and highlight their role in ensuring the speed of order execution on the exchange.

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. Alice needs to send dirhams to Bob, but she only has dollars, as mentioned in the example above. 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. Such an operation aims 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, will execute your order for the operation 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 evident because you can use the local currency for multi-currency payments and transfers abroad. There are no currency risks, each of the parties will receive the required currency, and there are no additional fees and commissions.

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

Highly liquid market

This approach creates a highly liquid market. As you have already understood, the user can use applications outside the exchange, but most of the transactions will pass through it, which will affect the increase in liquidity.

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 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 may not be personally connected but are technically connected, which positively affects trading operations.

Completing testing, integrating, and launching TKEY Online

We tell you what processes have already been completed and what awaits us soon.

In early March, we completed testing the trading functions and their interaction with the entire ecosystem, 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 Russian presentation of the TKEY ecosystem; 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. As users of the system, you can indirectly participate in this, for example, connect as market makers and more.

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

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

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

Thank you so much for being so attentive; stay tuned!