Why we need decentralized exchanges for financial products.

Lucas Roorda
First Distributed Investment Bank
9 min readJun 22, 2018

In our first article, we explained that at DIB.ONE we develop open protocols that use the Ethereum blockchain for initiation, trading and settlement of financial products and derivative contracts. We envision and develop a borderless ecosystem for peer-to-peer cooperation and trading. In this article, we explain how a centralized derivatives exchange works, and how a decentralized one should operate.

The evolution of trust

Through the centuries, we have seen trust shifting. Before the industrial revolution, people used to trade directly with each other, but trust shifted to factories and enterprises afterwards. With the rise of technology, companies such as Uber and Airbnb enabled us to optimize the utilization of our assets in the so-called sharing economy. Now, the latest paradigm shift in trust is called Blockchain Technology. By using blockchain, trust in a single third party is not needed. In convergence with Artificial Intelligence (AI) and Internet-of-Things (IoT), optimal synergy can be reached, and many trusted third parties can be made obsolete. Thereby, efficiency, transparency and control over data ownership are increased. But why do we hear so much about Blockchain, but rarely see it implemented….?

The evolution of trust.

Blockchain’s current state: hyped, immature and with unfulfilled potential.

A hype
In 2017,
more than $6 billion was raised during Initial Coin Offerings (ICOs), but from the 902 ICO-projects, according to fortune.com, approximately 59% have failed already. In the market turbulence of 2017, many ridiculous ideas have managed to raise money through ICOs and ridiculous coins have come to life. The Useless Ethereum Token.. Putincoin.. Trumpcoin.. Fuck Trump Coin…. You name it. Many ICO-projects managed to raise money, mainly on Ethereum, without having a clear use-case for blockchain or a token-sale and Vitalik Buterin, the founder of Ethereum, publicly warned for scammy ICOs.

Projects that are developed on Ethereum utilize blockchain as a backbone that has no possibility of downtime, censorship or third-party interference. The coins sold during the ICO are used as a means of payment in the, to be developed, application. The use of Ethereum in an application has immense value if it comes to peer-to-peer, immutable, traceable transactions that are done in various jurisdictions.

Immature
Currently, many bright minds from all over the world are developing Blockchain Technology and its ecosystem to increase usability, transaction speed and security. Currently, the technology is always bound to certain trade-offs between decentralization, speed and security. So far, only 2 out of 3 have been reached in a single blockchain:

High Speed + High Decentralization = Low Security

High Speed + High Security = Low Decentralization

High Security + High Decentralization = Low Speed

It is desirable to have all three elements because this makes a blockchain perfect for implementation in business. So far, there is no blockchain yet that facilitates all three elements, but, as mentioned in the previous post, we are very excited about Ethereum’s scaling solutions that will improve transaction speed and throughput, while keeping high security and high decentralization.

High Speed + High Decentralization + High Security = Perfect Blockchain

Blockchain’s potential not fulfilled
The inception of Bitcoin came forth from the idea of trade on the internet without financial intermediaries. Ethereum elaborated on this idea by implementing smart-contracts on their blockchain. These ‘Turing-complete’ smart-contracts allow you to program any human commands (IF this, THEN that) or subledgers, save it in the blockchain and have it maintained by miners.

Smart-contracts are immutable and maintained by miners.

Because of the immutable and decentralized nature of blockchain, a smart-contract cannot be changed or cancelled once it is deployed. The set of commands that is coded in the smart-contract will always be carried out by miners. In fact, you can program a virtual bank or insurance company that will work according to predefined rules and no one will be able to change this logic.

On a blockchain, the amount of tokens that are in possession of a person are recorded through public/private key encryption. The public key can be seen as the account number and the private key can be seen as the access key to sign orders for this account. Note, that a single public key can own multiple types of tokens on the same blockchain!

‘A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution’. Satoshi Nakamoto.

As a result of smart-contracts’ capabilities, many new tokens that serve as a means of payment on a specific platform have been created on the Ethereum network. The price of the token purely comes from the demand and supply for the token and currently, buyers and sellers of tokens are connected with each other through exchanges. On a centralized exchange, (as Binance, Poloniex and Bitfinex) a user opens an account by using his e-mail address. Connected to the account are newly generated public keys. Not the user, but the exchange holds the private keys that are connected with these public keys. If user A wants to sell his ETH for BTC, he first sends his ETH to the public key that is connected to his account on the exchange. The exchange holds its own bookkeeping regarding accounts and holdings, and does all the necessary clearing. This allows for split-second trading as not the ledgers on a blockchain, but just the ledgers of the exchange are adjusted. Only when tokens leave the exchange, ledgers of the corresponding blockchain are adjusted.

A centralized crypto exchange is exactly the type of financial institution that Satoshi Nakamoto wanted to surpass with his design for Bitcoin.

The fact that a centralized exchange as described above holds all the private keys, makes it a honeypot for hackers. By hacking the exchange and gaining access to the private keys, tokens can be transferred from public keys that belong to the users of the exchange. Another drawback of centralized exchanges is that liquidy in the market is fragmented instead of having all orders in one place. This results in different prices in the market for the same underlying value. If an exchange does not have high liquidity for a token and has struggles to match large orders, this can result in a lower or higher price than would have been on a single marketplace. As mentioned, one of the main benefits of blockchain is that it has no downtime and even if half of the miners are offline, transactions will be processed. Users of a centralized exchange always depend on the exchange to process transactions and can have nothing more than faith that exchanges do not take part in front-running practices. Note, that these are only the most obvious disadvantages of centralized exchanges!

Centralized Derivative Exchanges
Just as centralized exchanges that allow for buying and selling tokens, there exist centralized exchanges (For example www.deribit.com) that facilitate derivative trading with margins in crypto. These centralized derivative exchanges also work with their own ledgers. A user again sends his crypto to the wallet connected to his account and then gets credited on the platform. With this credit, the user can trade financial contracts of which the state is maintained by the exchange. Centralized derivative exchanges have the same problems as regular centralized exchanges have.

The solution: Decentralized Trading Protocols

Recently, Coinbase, one of the biggest crypto-to-fiat exchanges acquired Paradex, a decentralized exchange for peer-to-peer swapping of tokens that are traded on the Ethereum network. Paradex makes use of the ‘0x protocol’, that allows 2 parties to swap tokens with each other without the interference of a third party. Opening an account at an exchange and sending your money to the public key connected to your account is not necessary. This philosophy not only harnesses the true blockchain spirit, but also utilizes all advantages that cryptocurrency brings to us.

Peer-to-Peer Token Exchange
Protocols as
0x and Loopring make use of smart-contracts on the Ethereum network that allow 2 parties to swap tokens with each other. First of all, users of the protocol must send a message (signed with their private key) to the Ethereum network that allows miners to change the balance of their public key if they are instructed to do so. This message says that IF_A message that is signed with the private key belonging to the public key tells them to change the balance THEN_change the balance. The second step is that the user publishes a ‘sell’ offer in the smart-contract, thereby stating an expiry date of the offer and the amount and type of tokens he wishes to receive in return. To make the offer visible for potential buyers, decentralized exchanges as Paradex publish the open offers on their platform. Buyers will see the order, and, just as the sellers, first send a message to the protocol that allows miners to change their balance. The second step of buyers is to send a message to the smart-contract to fill the sell order and swap the tokens. The smart-contract checks if all parameters (exchange rate for tokens, expiry date and correct public/private key combination) are correct and carries out the swap. The user remains owner of the tokens until the smart-contract makes the swap.

Decentralized exchanges currently have the same scalability problems as the underlying blockchain, and transaction speed depends on the gas-price a user adds to the message. The main advantage is that no third party is needed for swapping the tokens, and the ‘honeypot’ risk of centralized exchanges is eliminated. Another benefit is that these protocols cannot be taken down by anyone, including three-lettered-agencies, and have a 100% uptime.

Decentralized exchanges keep all the advantages of blockchain technology, such as security and immutability, but also inherit its challenges, such as speed and scalability.

Are there protocols for decentralized derivatives trading?
Yes! Well.. sort of! Several projects are aiming to facilitate peer-to-peer derivatives trading, but none of them is live on the mainnet of Ethereum yet. Variabl launched a test version in the end of 2017 and dYdX is currently live on the testnet. The main idea of decentralized derivative trading is that people can trade financial contracts without any intermediary, but the Ethereum network. This helps driving down costs and reducing counterparty risk but also opens new business cases. dYdX and Variabl focus on options, futures and CFD’s. We also aim on providing these products, but also envision other financial products that are peer-to-peer. For example, insurances where people insure risk for each other, where insurance companies can not or may not insure this risk.

Currently, peer-to-peer derivative trading encounters several drawbacks that can be overcome with changes in the blockchain protocol and development in the ecosystem. Just as decentralized exchanges, decentralized derivative exchanges also feel the limits in speed and throughput of their underlying blockchain. Besides, derivative contracts have a starting date and end-date. This results in the necessity of data input, for example of the $ price of an underlying value, from outside of the blockchain. This source is centralized and therefore, currently, a weak spot. Projects like ChainLink try to solve this problem by facilitating decentralized oracles. Nodes in the ChainLink network stake their money and are economically incentivized to deliver the correct data by being rewarded for delivering the correct data and being punished, by slashing the deposit, if their data input is different from other nodes. Important here is to keep in mind that economic costs should always outweigh economic gain to ensure a financially solid system!

What is not there, but is needed? — Opium Protocol
At DIB.ONE we are developing the Opium Protocol. This protocol imitates existing exchanges in terms of ease of use but leaves ownership and control of positions in hands of its users by using of a set of smart-contracts through which they can initiate, trade and settle financial contracts in a peer-to-peer way. Our contracts work with margin deposits, and, depending on the needed security, (de)centralized oracles. By using oracles, almost any synthetic position can be created on, for example, gold and oil, but also on Bitcoin.

What is next?

DIB.ONE was founded by professional derivative traders and the key principle of our team is to deliver financial products of superior quality for our ecosystem. In the near future we will publish documentation, so we invite interested readers to follow us on social media or subscribe at DIB.ONE to stay updated on our latest developments.

P.S. Polina Slovenko, thanks for co-writing this article.

--

--