idap.io hybrid exchange coming in 2019, first step towards completely decentralized architecture

Awanish Rajan
Bitfex
Published in
6 min readJul 25, 2018

Hello everyone! We are glad to announce that idap.io will be going forward with incorporating a Decentralised Exchange protocol into its architecture, which will be built on the Wanchain interoperable blockchain. We feel that the time is right to take this direction and we want to share the rationale behind choosing this exciting new addition to our platform.

In the past few months, we have progressed wonderfully with our exchange’s development. The prototype for our Desktop Trading Interface, the most advanced application ever created for crypto trading is complete already! It has a ‘point-and-click’ ladder-based trading interface thus enabling trades with a single click. The UI has been designed to be powerful as well as seamless; all your orders are displayed neatly in ladder form and you can execute orders quickly without worrying about missing out on all the market action. It supports multiple screens, so you can spread out the information you wish to view in a sane fashion across multiple displays. Moreover, the desktop app’s amazing customisability can be experienced through the freedom of creating, storing and loading multiple workspaces, where a host of parameters can be set as per personal preference. You can view a demo of our prototype by visiting https://www.idap.io/product-demo. We will soon release a web version of our trading interface.

Parallel to the developments, we were working on, we were also researching the best way to decentralise our exchange architecture, as it gives more power to the people. We explored many protocols, but at the point when we had just started building our exchange, none seemed to be suitable for the kind of decentralised exchange we wanted to deliver. Thus, we continued ahead with a centralised architecture while keeping a keen eye on the progress of the various DeX protocols. We especially liked Wanchain’s platform and have been in touch with their representatives to gain a better understanding of the interoperable blockchain. We discussed aspects and merits of building a DeX on Wanchain and in conjunction with months of research and deliberation, have now decided to go ahead with a hybridised model to maintain efficiency, performance, security, and speed, with on-chain settlement and off-chain order book, with the decentralised portion being implemented on Wanchain.

DeX

Through a decentralised exchange, customers trade directly from their own wallets without depending on the centralised exchange to hold on to their funds, thereby ensuring improved protection against the types of hacks many centralised exchanges have suffered over the years. Secondly, since the funds are distributed across the network, even in the event of exchange downtime or lockdown, users are still in complete possession of funds and do not have to worry about withdrawals. Trading is done by atomically swapping the cryptocurrency coin/token between participants, which can be achieved in different ways as explained later. Atomic swapping essentially means a mechanism through which coins on different blockchains are exchanged without trusting a third party, wherein neither of the two parties involved in the trade is at risk of their funds being stolen. The trade either completes with both parties getting the coins that they agreed upon, or the trade fails and both parties get their coins back.

Though DeX is in the spirit of decentralisation and gives network participants more control over their assets, as a protocol it needs various improvements, an absence of which will keep hindering its adoption and is the reason DeXs today do not command volumes comparable to a CeX.

  • The issue of liquidity, in both fiat and cryptocurrency, makes it unattractive for professional traders to engage with a DeXs. Institutional grade investors will especially stay shy of DeXs till this is fully addressed.
  • With lack of liquidity, comes slippage. As volatile as crypto markets are, on a centralised exchange various mechanism ensure minimum slippage wherein on a decentralised one this is still to be effectively tackled.
  • The speeds of trades are yet to match those of centralised exchanges. On-chain order books can lead to the problem of frontrunning while following off-chain order book coupled with on-chain settlement approach still does not achieve the efficacy of an automated match-making engine of centralised exchanges.
  • The issue of scalability is a pressing matter for existing blockchain themselves and a surge in members of the exchange will determine how scaling up can be achieved with minimal exchange downtime. At the moment, centralised exchanges have a clear advantage of DeXs.

The areas of interest highlighted above are in the context of conducting spot trading of cryptocurrencies. With idap.io being a crypto derivatives exchange, migration to a decentralised structure needs to be examined under the same light.

Crypto Derivatives on a decentralised exchange

A decentralised derivatives exchange implementing not just all the offerings we are bringing to the market but also the functionalities we are delivering would not have been possible with the current progress at a protocol level. Notably

  • The integration of FIX API for high volume HFT is currently not available for DeX. At the protocol level, there is no support for algorithmic trading, neither on-chain nor off-chain.
  • The implied logic for futures, spreads, and butterfly is only possible if a centralised matching engine is used. Again, no support for implied orders for derivatives at the protocol layer makes it prudent to opt out of a decentralised exchange.
  • P2P margin lending is possible through smart contracts, however, restricted flexibility in terms of leverage as it cannot be changed.

To ensure no trade-offs in performance for decentralisation, we are opting for a hybridised exchange, where settlement happens on-chain while automated matchmaking via an off-chain engine lets the exchange tap into the speed, liquidity, and performance of the level seen on legacy trading platforms.

As progress is made in decentralised exchange protocols to incorporate FIX API, automated trading and other functionalities that are so ubiquitous on traditional exchanges, we will migrate to a completely decentralised architecture.

Phase 1 towards decentralised exchange

An overview of the two ways to conduct atomic swaps is important when talking about DeX and thus we are briefly putting out the two methods.

The first way is a multi-signature notary mechanism, a modified version of which has been implemented by Wanchain. Using cross-chain interoperability of the Wanchain, assets can be swapped between two different chains. The consensus protocol for the confirmation of the swapping involves a system of validator, voucher and storeman nodes. The swapping involves smart contracts and creation of corresponding tokens for the coins being swapped. The abovementioned three types of nodes enable the requests for swapping to be validated, gathering of consensus and finally broadcasting the validity of the swap and asset transfer. Security is ensured by incentivisation rules and cryptographic ring signatures. A more detailed description can be found in the Wanchain White Paper.

The second way is using hash-locked smart contracts, as demonstrated most notably by the Komodo platform using timed hash-locked smart contracts. In this case, assets are locked using a smart contract and hashes, with the liquidity provider having to make a security deposit atop the coins he wishes to exchange with the liquidity receiver. All funds stay locked till hashes have been verified by one party using public signatures of the other party and vice-versa. The receiver gets her funds, post which the provider is also able to get his funds. With this, the swap is completed, and the deposit is refunded to the provider. Currently, BTC/ETH swaps are not possible with the above method. You can refer to the Komodo White Paper for further details.

A variation of this atomic swap is the etomic swap that allows swaps between BTC and ETH. It, however, involves the creation of ‘etomic tokens’ to complete the swap since BTC code functionality is incompatible with that of ETH and thus involves intermediary token creation. In contrast, Wanchain is able to swap tokens on any two blockchains.

With Wanchain’s suite of features for development on its platform on top of the cross-chain interoperability, we plan to continue development of the decentralised portion of our exchange on its blockchain.

We will keep the community updated about the developments as they happen via our various channels. We will be awaiting your feedback and would be glad to work with those who would like to contribute to the DeX development. We will release detailed plans soon. Thank you.

--

--