This article is the first in a series of six that aims to give a broad overview of the new wave of self-custodial exchanges that are poised to meet the needs of professional traders. For the first time in the industry, traders now have several real alternatives to the larger centralised exchanges.
The series will focus on six key pieces of exchange infrastructure that together, give traders the complete toolset that they need to take advantage of market opportunities effectively:
‘Speed’ in some form or another is at the heart of all trading activity. In a competitive trading landscape, the quicker a trader is able to take advantage of market inefficiencies as they present themselves, the higher his/her opportunity set and therefore the higher the potential returns.
In a recent 2020 DeversiFi survey of 60 professional crypto traders, funds and trading firms, concerns surrounding 'speed' (or lack of it) was quoted as one of the seven most important reasons preventing professional traders from using self-custodial exchanges. Put simply, traders will compromise on custody and the security of their assets to some extent, provided that they can trade quickly, as higher speeds mean higher trading ‘edge.’
Execution, Clearing and Settlement
When discussing speed, it is important to make the distinction between speed of execution, speed of clearing and speed of settlement. Executing a trade efficiently, but then having to wait for an extended period of time for the trade to clear and/or settle, can put a strain on a trader’s capital and result in a poorer return on capital over time. Conversely, having slow execution speeds, regardless of high clearing and/or settlement speeds can result in trading opportunities being missed altogether.
Large centralised crypto exchanges such as Bitfinex, Coinbase and Kraken have addressed this issue by effectively combining execution with clearing. The exchanges are aware of all traders’ balances at all times and therefore trading is limited to the funds that are held on account for each individual trader (ignoring credit or leverage for now). Traders’ balances are updated almost instantly following execution, meaning that clearing and execution are one and the same thing. A trader on a centralised exchange can capture market opportunities on that individual exchange, but then has to wait for an uncertain amount of time to settle balances on the blockchain (by withdrawing), before being able to capture trading opportunities on other trading venues.
In legacy finance, settlement and clearing is also separated, with brokers and clearing houses being responsible for ensuring that imbalances are settled between counterparties at distinct time periods and that trading firms trade within their means on multiple exchanges and trading venues. Such legacy systems are built on the premise of credit risk, membership, exclusivity and reputation.
Self-Custodial/DEX’s Of the Past Few Years
Self-custodial exchanges are peer-to-peer crypto trading venues where traders keep control of their assets at all times. Instead of transferring their tokens to a centralised exchange, effectively giving up control of their assets (not your keys, not your assets), traders either use their Ethereum key to execute, clear and settle each transaction on-chain, all at the same time, or transfer their tokens to a smart contract first before signing orders against an off-chain order book to execute. For the latter example, clearing & settlement follow shortly afterwards depending on the amount of time the Ethereum blockchain takes to mine the settlement transaction.
For the purposes of this article, we will refer to the exchanges that directly execute, clear and settle each individual trade on-chain as a decentralised exchange (DEX), and exchanges that use an off-chain order book, but settle trades on-chain, as self-custodial exchanges.
Protocols such as Kyber and Uniswap fall into the DEX category. Effectively, order books are broadcast on-chain (Automated market maker systems) and traders have to compete to execute by submitting their orders directly to the Ethereum blockchain. New Ethereum blocks are mined only once every 10-20 seconds and only a finite amount of transactions can be included in each block. A professional trader trying to trade large clip sizes is competing for the same space as a trader who is swapping a few dollars of token via an app, playing blockchain games such as CryptoKitties or transferring Tethers (USDT) to pay expenses.
Self-custodial exchanges such as DeversiFi 1.0 and IDEX 1.0 have improved on the concept of a DEX for professional traders over the past two years, by allowing for high speed execution. This is achieved by hosting the order books ‘off chain,’ similar to centralised exchanges. Once a trader has locked their tokens into a smart contract, whilst still maintaining control at all times, the trader can submit, modify and change orders just by signing each change with their Ethereum key. This is instead of having to submit a full transaction to the Ethereum blockchain every time they would like to update an order. This saves gas fees and enables traders to employ more advanced trading strategies that are dependent on quickly being able to update orders. Depending on the matching engine technology being employed by self-custodial exchanges, speeds of execution are more than adequate for all but the more advanced low-latency trading strategies.
Despite self-custodial exchanges being more ‘useful’ for serious traders compared to pure DEXs, both DEXs and self-custodial exchanges over the past several years have still required each individual trade to be settled on the Ethereum blockchain itself before the trader’s balance is re-tradable. Effectively clearing and settlement happens at the same time. In periods of extreme market price volatility, the Ethereum blockchain can quickly become congested, with businesses who are gas price inelastic having to settle trades at ever increasing gas prices. The latest example of this was on the 12th March 2020 in the colloquially called ‘Black Thursday’ when an extreme Ethereum price collapse led to the average price of gas spiking 900% from just under 10 Gwei to 85 Gwei. Individual transactions were settled at upwards of $20 per transaction and many traders waited for upwards of six hours for their trades to be processed.
Self-custodial exchanges of the past such as DeversiFi 1.0 have catered for slightly more advanced time sensitive trading, such as arbitrage, swing trading or scalping, but the slow speed of clearing & settlement has prevented this more advanced trading at scale. Kyber, a protocol focused on on-chain token swapping has averaged $5m per day of trading volume over the past several months, whereas self-custodial exchanges such as IDEX 1.0 and DeversiFi 1.0 have only averaged a few hundred thousand dollars of volume between them. Clearly self-custodial exchanges up until this point have failed to cater for professional crypto trading at scale.
‘Layer Two’ Settlement Scaling Solutions - Validity Proofs vs Fraud Proofs
Exchanges such as DeversiFi, IDEX and Loopring are now in the process of upgrading their self-custodial exchanges to take the clearing between traders of the same exchange ‘off-chain’ in what is known as ‘layer two’ scaling. This technology solves the clearing bottleneck and enables these self-custodial exchanges to cater for sophisticated professional and algorithmic traders who rely on fast balance updates to scale their trading operations.
The new layer two scaling solutions being employed by DeversiFi, IDEX and Loopring can be broadly split into two categories, Validity proofs and Fraud proofs
Validity proofs batch transactions using cryptographic proofs, and can therefore guarantee trade finality, scalability, security and privacy. Fraud proofs rely on ‘live’ verifiers to check the validity of each trade, and are therefore prone to greater attack vectors (game theory security model) which need to be managed by limiting the performance of the system. Fraud proofs have the advantage of having more existing wallet connectivity (due to the way orders are signed) and are more generalised, meaning multiple applications can interact on the same rollup.
Within the two different proof models there is a further differentiation between how data is stored - on-chain or off-chain. Holding data off-chain (Validium) means that trading is private, but there is a trust tradeoff, whereas pushing all data on-chain (ZK-Rollup) means that trading is not private, but there is less trust needed in the system.
A good comparison between Optimistic Rollups and ZK-Rollups can be found on EthHub.
Layer 2 Self-Custodial Exchange Clearing and Settlement Speeds - "Throughput"
Depending on their design, layer-two self-custodial exchanges can rival even the largest of centralised exchanges in terms of speed of execution, speed of clearing and speed of settlement. Professional traders now have self-custodial trading venues that perform the same as centralised exchanges such as Kraken or Binance, but with the added security & control that self-custodial trading brings.
Validity Proof scaling systems (Validium and ZK-Rollups) are better suited for high speed trading compared to Fraud Proof (Optimistic Rollups and Plasma) for several reasons:
1) Fraud Proof systems (IDEX) need a network of incentivised validators/stakeholders to constantly monitor the system and then challenge it if the exchange tries to ‘cheat.' This game theory approach relies on enough data being made available to enable such challenges, and limits the amount of transactions that can be periodically settled on the main Ethereum blockchain. Therefore such systems have a limited throughput.
2) Validity Proof systems (DeversiFi & Loopring) on the other hand bundle thousands of transactions into one settlement batch and use zero-knowledge cryptographic proofs to demonstrate that each trade is valid. The ‘validity proof’ means that such systems have a much higher throughput. For example, StarkWare’s ZK-STARK based technology has been measured at handling 9000 transactions per second - a number which is only bounded by computing power, not the underlying blockchain speed.
Layer 2 Self-Custodial Exchange Execution Speed
Solving the clearing speed bottleneck via layer-two scaling solutions is only one half of the equation when it comes to overall trading speed. The other half of the equation is execution speed. A self-custodial exchange is only as good as the matching engine technology that it employs. Traders need to be certain that trades can be matched and processed quickly during times of high market volatility.
As self-custodial exchanges scale their customer base over the course of the next several years their matching engines will be tested at scale for the first time. Ensuring that the new wave of exchanges can cope with high demand will be key in maintaining customer loyalty and satisfaction. Whilst several of the new wave of exchanges have untested matching engine technology, DeversiFi made the decision early on to use battle-tested Bitfinex matching engine technology to ensure continued high performance during load spikes.
Layer 2 Self-Custodial Exchange Trade Finality
Validity proof systems have the added advantage of guaranteeing trade finality the moment the trade is executed. Due to the validity proof that is generated, there is no opportunity or need in the system for a third party to challenge or break the trade. From a traders perspective, once the trade has been executed it is final. This is incredibly important for trading firms who require absolute certainty, such as those with complex portfolios, those operating at speed or those who need to hedge their positions quickly
In contrast, as fraud proof systems require a ‘challenge period’ where stakeholders/validators can examine the trade data and challenge the system in the event of suspected cheating. This delay to the proof system, means that a trade is at risk of being rolled back in the instance a good actor spots a genuine cheat, or a malicious actor(s) interrupts the system with continuous challenges. Such challenges can be relatively inexpensive in some systems.
In summary, the self-custodial exchanges that have now launched with zkRollup layer-two scaling technology, such as DeversiFi and Loopring, are now capable of clearing thousands of transactions per second.
Professional traders now have access to the same speed of execution, clearing and speed of settlement that they are used to on large centralised exchanges such as Binance or Kraken.
A further article in this series will go on to explain how settlement is actually vastly improved on layer 2 self-custodial exchanges by guaranteeing when withdrawals (leading to settlement on the blockchain) will be processed.
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.