A Brief History of Exchanges
The concept of the exchange has existed for hundreds of years and has taken many different forms throughout history. It performs 2 basic functions - price discovery and settlement.
Price discovery is the mechanism which ensures traders are aware of all offers on the market (best prices). In its most basic version that could just look like a place and time of day when participants in the market would meet to trade. Nowadays it looks like databases with thousands of bids and asks that update millions of times per second - but the function is essentially the same.
The second function of the exchange is clearing & settlement , which is to ensure that all deals that have been agreed are then honoured and assets exchange hands accordingly.
When we make a trade using an exchange we are making a deal to exchange one asset for another one with someone who wishes to do the opposite. The exchange is the agent or mechanism that facilitates this deal. Since we are dealing with 2 other participants we are potentially exposed to risk by both of them - exchange risk and counterparty risk.
In essence, when creating a trading system, we are trying to optimize the main functions - price discovery and settlement, whilst mitigating the risk (exchange and counterparty). Let's consider and compare 3 different approaches to this balancing act.
Trust between counterparties. In the traditional financial system (e.g. NYSE, Nasdaq) the functions of price discovery and settlement are handled by different parties. During the opening hours of the exchange (e.g. 8am - 5pm) orders are submitted and trades are agreed (this all happens electronically). The assets being traded are held in a network of clearing banks. Once the market is closed the assets are transferred between the different banks to reflect the trades made throughout the day. This system largely depends on trust between the counterparties, reputation and legal enforcement of contracts. The requirement for a level of trust between all the members of the exchange has a significant impact on how many members there can be. The largest exchange in the world - NYSE, only has 1366 members (1). This is a very exclusive club, and for most investors reaching the exchange means going through layers of brokers.
Trust in a centralised party. What if the assets one wants to trade are not part of the existing financial system? What if there are tens of thousands of participants in the market? A simpler and more efficient version is to entrust one chosen party with all assets, therefore substituting the need to trust all the counterparties with the need to trust just one. This represents the dominant model of cryptocurrency exchanges today- all users send their funds to the exchange operator where they are kept making sure everyone can meet all deals entered in.
This is a relatively simple model which allowed for the creation of robust and fast systems that offer different financial products (e.g. margin, derivatives). Upwords of 96% of digital asset trading volume happens at such exchanges - e.g. Binance, Kraken, Coinbase. However, the critical drawback of this model is that there is an enormous pressure on this central trusted party to be compromised. Such exchanges hold over $10 billion in Bitcoin, Ethereum and USD Tether (2). There is a huge motivation for external parties or even the exchange operators to be malicious and embezzle user funds. Since cryptocurrency trading gained popularity in the last 5 years - billions of dollars have been stolen in such attacks (3).
Trust in the blockchain. The introduction of blockchains which support smart contracts introduces a 3rd option. In this article, we will focus on the Ethereum blockchain. Smart contracts programmatically execute instructions only if specific conditions are met - e.g. your funds will not be sent unless the other party sends theirs. This means that there is no need to trust neither the other party nor the exchange, only the integrity of the blockchain.
Trusting the blockchain is a significant conceptual leap for the financial system and has led to the proliferation of Decentralised Finance. Popular exchanges that utilise this principle (like Uniswap or Kyber) record all information required for trading on the blockchain (available bids/asks and user balances). This means that this system does not rely on the operator and cannot be shut down or censored as long as the blockchain is secure. However, because all these operations happen on the blockchain, there are a few limitations. First, the speed at which these interactions can happen is significantly slower than capital markets standards - new information such as updated user balances or bid/ask data can only be added to the Ethereum blockchain every approx. 15 seconds compared to 1000s of times per second in traditional capital markets. This slow speed, combined with the fact that network fees need to be paid for each transaction, has the knock on effect of creating a large spread between the best bid and ask. Secondly, an obstacle for traders is that participating in such a system requires one to “broadcast” (make public their trade) before (and if) it is entered into the smart contract. This causes ample opportunity for front running. Stay tuned for our privacy focused article where we dive deeper into front-running.
A novel approach
Learning from the three popular models above and taking advantage of the latest technology available has allowed us to create the self-custodial exchange. This exchange combines the best elements of each to create an even better balance between the optimisation for price discovery and settlement and the reduction of exchange and counterparty risk.
The way DeversiFi achieves this balance relies on a few key factors.
- All user funds used for trading are kept within a smart contract. This ensures all trades can settle at all times, removing counterparty risk
- All information required for the operation of the exchange (placed orders, user balances, order history) is stored “off-chain”, a normal database. This allows for information updating to be extremely quick and match the performance of advanced capital markets.
- A Zero Knowledge Proof of the current state of this database is generated at set intervals of time and committed to the blockchain (e.g. every hour). A Zero Knowledge Proof is a piece of information (the proof) that can verify that a much larger piece of information (the exchange database) exists in a certain form, without revealing that underlying information. In this case the proof validates that all trades have been signed correctly, that all users had enough balance to begin with, and that the balances were updated correctly.
- This also means that for a trade to be valid it needs to be signed with a user’s key when the order is submitted. This elevates the level of security of order placement to that of the Ethereum wallet the user is using. DeversiFi supports best in class hardware wallet Ledger to offer top tier security. See more information on wallet security
- To ensure that even in the disaster scenario where the exchange operator goes down completely, the underlying private information that can be verified with the public proof is held by a number of other parties. In the case of DeversiFi those parties are- Infura (one of the largest node operators in DeFi) (4), Bitfinex (the largest ETH holder) (5), Consensys (operator of one of the most popular wallets in DeFi - Metamask), StarkWare, Nethermind and Cephalopod. This data availability committee (DAC) is required since not all data is made public, which ensures that traders activity on the platform is private.
There are a number of variations on this method of Layer 2 scaling, some of which don’t include a DAC. For a more detailed review, check out this article on the Data Availability spectrum. The solution described above, termed “validium” is currently used by DeversiFi (before upgrading to the more flexible “volition”) and has been chosen because of its inherent privacy, finality and high speed, which are key for a trading system.
Why self-custody matters
So there is an exchange that is functionality fit for trading and does not require trust in the counterparty or the exchange operator. Why does that matter?
Exchanges naturally benefit hugely from network externalities - meaning the more traders (offers/liquidity) there are on an exchange the more valuable it is for all the participants.
Hence, if the system is constructed in a way where none of the parties interacting need to trust each other, it has an uncapped growth potential. Anyone can join without having to worry or verify who else is in there - it no longer matters.
DeversiFi gives traders the edge in fast moving decentralised finance (DeFi) markets by allowing them to trade at lightning speed and with deep aggregated liquidity, directly from their privately owned cryptocurrency wallet.
Traders can take advantage of more trading opportunities while always preserving control of their assets for when they need to move fast. DeversiFi’s order-books are off-chain, but settlement occurs on the Ethereum blockchain. This means that traders benefit from fast moving order books and instant execution, without having to trust the exchange and whilst always maintaining control of their assets at all times.
For the first time, traders can enjoy all the benefits that they would expect from a legacy large centralised exchange, but with no exchange or counter-party risk.