Decentralized Exchanges Moving On-Chain
First of all, I believe that decentralized exchanges are the future of asset exchange because they provide a unique opportunity to democratize the network effect that most central systems use to monopolize their services. With that being said, I think that there are MANY obstacles in their implementation. I am simply pointing out the problems. I do not generally mention specific platforms because I like to look at a higher abstraction of a problem.
There is not current solution of these, and many of the problems are simply including some off-shoot of a consensus mechanism, mixed with a staking method and some type of clearinghouse system architecture. True, some consensus mechanisms differ and some staking methods are more novel than others, but let’s not split hairs here.
What is a Decentralized Exchange?
A decentralized exchange is recognized as a central exchange clearinghouse for the buying and selling of decentralized tokens or assets. Examples include Kraken, Bitfinex, and Coinbase. They bring together individuals that want to sell and buy these assets, so the value add for them is that they bring liquidity to the markets. This reduces volatility, but it cuts liquidity into different segments of disjoint networks, this allows for price inefficiencies through arbitrage. For instance, if a certain token is priced at $50 dollars at Kraken and it is priced at $55 dollars at Bitfinex. This increases with changes in geographic location, and is known as an arbitrage opportunity.
What it means vs. what it is
Most “decentralized exchanges” are not truly decentralized, but rather rely on a centralized process to buy and sell assets in a peer-to-peer manner. With that being said, there is a new type of decentralized exchange, an exchange that is truly decentralized because it is a part of the blockchain. Examples of these true decentralized exchanges are 0x, Cosmos, the OmiseGo wallet system, and Kyber.
How do they work?
These decentralized exchanges promise to allow for a decentralized outlet to buy and sell these assets. These exchanges work by having decentralized assets pegged to more well-known currencies like bitcoin or ethereum. This provides central assets to give a metric upon which to trade and sell. They find the volume on-chain rather than finding it off chain and then engage the transactions on-chain.
Why are Decentralized Exchanges Important?
Decentralized exchanges are so important because the problems that they face, represent the problems that blockchain must overcome to have mass consumer adoption and actual utility. I will not go into these problems to in-depth, but the one problem that resonates with me is the eventual democratization of networks. While centralized exchanges like the Nasdaq, Coinbase, and Bitfinex compete on the amount of liquidity (trading volume on each end), a decentralized exchange is different.
The Decentralized Network Effect on Liquidity
The goal of decentralized networks is to get rid of the centralized systems. This in turn, provides a source that anyone can hook into. The liquidity problem between centralized systems can be solved by connecting various decentralized systems. Instead of hoarding the networks the decentralized systems harness it. That means getting a hold of the long-tail for these specific prices, but otherwise there needs to be a consistent price for each scheme.
The Major Obstacle Decentralized Exchanges Face: Scalability
Despite this amazing potential, there are of course issues that arise when trying to switch from centralized to decentralized exchanges:
- sybil attacks
- Fake transactions to inflate volume
- legal issues with regards to securities
- Vetting of decentralized assets
The list goes on, but when it comes down to it, the biggest issue is that the current blockchain implementations cannot scale to the number of transactions that are needed.
While centralized markets can spin up new threads or add computational power to get around this, the nature of decentralized exchanges prevents a scaling of transactions to meet the current load. This leads to several dilemmas:
- Transaction Latency
In its current state the blockchain can only handle a certain number of transactions, these means that transactions can be backed up in a queue until the rest of the transactions propagate. This means transactions are not instantaneous, and can be impacted by price changes.
- Front-running the Market
Since all transactions in the queue are visible, it would easy for a market maker to see swaps that are requested and then beat these transactions by paying a higher amount for gas or mining fees.
A Faster Consensus Mechanism
The most popular method for scaling these decentralized exchanges is to create a faster consensus method for transaction validation. These consensus methods are generally some form of proof of stake or tendermint consensus mechanism. They get around the timing issues of proof-of-work, by having a slashing mechanism for malicious block creators. Unfortunately, in a decentralized exchange there are issues with this system:
- How are transactions chosen for the next block?
There exists a high incentive for market makers to “vote” or stake blocks that they know will propagate their transactions. This creates the same issue that is found in current markets, and in the same way it is nearly impossible to prove that a transaction. This is another example of market front-running.
- Bottleneck on Transaction Time
No matter what the capacity of the network is, there is always some upper bound on the number of transactions that can be done. This means that there will always be a bottleneck if the consensus mechanism does not have the number of transactions grow with the size of the network.
The idea of a decentralized exchange is meant to cope with all transactions and spread throughout the world. This means that these networks need to be able to handle massive transaction throughput.
Off-Chain Decentralized Exchanges
There are implementations of off-chain decentralized exchanges. Often these decentralized exchanges rely on the future assumption that there exists some off-chain implementation like Plasma or the Lightning Network that will fix everything for them. Even with the assumption that these off-chain networks have already solved problems like blockwitholding and the exchanges have solved issues regarding switching between currencies, there is still another dilemma.
To gain any value in from these decentralized exchanges it is necessary to make the off-chain network incorporate a clearinghouse that can connects every other transaction. This is a problem that it is unique to exchanges because price volatility depends on the amount of liquidity.
How do you aggregate liquidity on an Off-Chain Network?
The point of an off-chain network is to bring a smaller party off-chain to improve speed without sacrificing security. The issue with this is that a decentralized exchange needs to have a large network to provide liquidity. There are some workarounds.
For instance, OmiseGo uses these off-chain networks as a way to cover the smaller transactions which is actually a good idea. The idea being that the smaller transactions would be easier to propagate across the channels. And would give the small fish a chance against the larger market makers. This is a pretty good idea, but you still have to deal with connecting the liquidity from on-chain to off-chain.
Also, it opens up the possibility of price differentials between off-chain and on-chain transactions because there would be more liquidity on the on-chain network.
As the number of users increases and the number of transactions increases, it becomes infeasible to have a “central” source of the truth for these decentralized exchanges, and more importantly for blockchain itself.
I am not a huge proponent of off-chain transactions because they do not actually solve the issue of scalability. Believe it or not the main issue with scalability is storage. It would be relatively easy to increase the speed of transactions, or to increase the blocksize, but this has not been for storage reasons. So instead of trying to figure out how to solve the issue with off-chain solutions or other forms of consensus, I think that we should work towards solving the issues with data management in a decentralized system as well as finding a way to dynamically ramp up transaction flow to match the need of the network.