...by Daniel Szego
quote
"Simplicity is the ultimate sophistication."
Leonardo da Vinci

Friday, May 29, 2020

Introduction to decentralized finance


One of today’s re-used slogans is DeFi (Decentralized Finance). The term was originally developed in 2016/2017 for decentralized applications that attempted to implement financial services over a blockchain platform. The meaning of the word has now changed somewhat and we mean mainly decentralized financial (or at least similar to financial) services implemented in a smart contract over the Ethereum system. The strength of the system is that each decentralized service can be used not only in a separate way, but in combination with each other in almost any way. This creates a coherent and mutually reinforcing set of organic services.

The ecosystem is based on the following basic protocols and solutions:

Tokenization: Decentralized finance is de facto based on tokenization and various token standards. Tokens provide both technological and business integration between different DeFi platforms, and in most cases the internal logic of each service is also implemented with tokens. The two basic token types are the so-called fungible and non-fungible tokens. A classic example of a replaceable token is a coin, where, for example, one EUR 10 coin is fully equivalent and can be replaced by another EUR 10 coin. The best example of a non-replaceable token is a theater ticket, where one theater ticket is generally not equivalent, it cannot be replaced by another theater ticket for another piece and location. Standards have also been developed for various tokens, such as ERC20 or ERC223 for replaceable and ERC 721 for non-replaceable tokens.

DAO: The basic operating logic of most decentralized applications is a kind of DAO (Decentralized Autonomous Organization) decentralized autonomous application. The bottom line is that there are no centralized roles or administrators, but everything that needs to change dynamically is based on the votes or majority decisions of a community. A typical solution is to produce so-called “maintainer” maintainer tokens where token owners are maximally and financially interested in the good functioning of the system but can change certain parameters of the system with their votes. This does not mean, then, that everything works in a fully automated and immutable way, just that those who can change certain parameters of the system are interested in making the platform work well.

Decentralized Oracles: One of the critical points in applications implemented with distributed ledger technologies is the integration of external data into the system. Because external data is entered using a component outside the blockchain, the security or non-hacking of the system is particularly critical. A classic example is when the pay for a sports betting smart contract depends on the outcome of a sporting event that needs to be imported from an external data source. If the external data source gives the wrong value, the prize may not be paid to the right person. This problem is usually solved by reading the data from several different independent external sources so that each data provider is motivated by some token to give an authentic value. Such a prolotocyte is called decentralized oracles.

With the help of the building blocks mentioned above, several more complex services can be built, which can be used individually or in combination with each other.

Stable cryptocurrencies: The biggest problem with cryptocurrencies is the dynamically changing exchange rate. This is attempted to be eliminated by stable cryptocurrencies whose exchange rate is pegged to an external currency such as the USD. There are three main solutions for cryptocurrency exchange rate stability:

- The exchange rate is guaranteed in a centralized way by an external company or bank. Then, of course, the reliability of the system depends heavily on the company that guarantees a stable exchange rate. This is how Tether works, for example.

- Collateralized stable cryptocurrency. What typically happens here is that a person pledges a certain amount of cryptocurrency in a smart contract and a new cryptocurrency is issued for it. For example, in Maker DAO, $ 200 of ether must be tied up for $ 100 of stable cryptocurrency. This provides the system with stability against extreme exchange rate movements.

- The third solution is to change the supply and demand of money in a completely dynamic way: to increase the amount of cryptocurrency in case of a falling exchange rate, and to decrease the amount in case of an increasing exchange rate. It is important to note that this type of solution has not yet resulted in a long-term stable cryptocurrency.

Decentralized exchanges (DEX): The logical operation of decentralized cryptocurrency changes is similar to their centralized counterparts, the only difference being that they run entirely on the blockchain without any centralized mechanism or control. Their mechanism of operation can be divided into two parts: in the first phase, in order-book matching, the sell and buy options are paired. In most decentralized exchanges, order-book matching only partially runs on the blockchain, the main reason being the limited efficiency of ethereum. In the second phase, the crypto assets to be sold and bought are exchanged in a fully decentralized manner (settlement). Examples of decentralized exchangre are Compound, Kyber, 0x.

Prediction Markets: Prediction markets can be considered as a further development of decentralized markets: here you can place bets in cryptocurrency on the output of an event (such as tomorrow's average temperature) and make a profit if the output is hit correctly. The main use of prediction markets is not gambling, but the accurate prediction of certain events. The basis of the mechanism is the so-called wisdom of the crowd: if many independent actors predict the outcome of an event, moreover, with a financial interest in predicting the correct outcome, much more accurate predictions can be made than what some experts can achieve. Examples of such platforms are Augur or Gnosis. Prediction markets are often the building blocks of other decentralized online insurance services.

P2P lending: P2P lending platforms provide the possibility of crypto or token-based interpersonal lending in some form of interest-like construction. Lenders and borrowers are usually paired through a decentralized smart contract-based system and the specific business is done through it. Examples of such platforms are EthLend or CoinLoan.

Decentralized portfolio management: Decentralized portfolio solutions typically manage a portfolio of some kind of non-fungible token. Portfolios can be created and run with different rules, such as open-ended or closed-ended, automatically or trader-managed, and so on. The technology also provides the ability to create so-called tagged portfolios, such as a green portfolio of only sustainable tokens.

Certainly, decentralized finance platforms are by no means completely problem-free. Their biggest drawbacks are their scalability and performance, which stems mainly from the limited scalability of the ethereum platform: 15 transactions per second and a turnaround time of around 2 minutes for secure processing. Another major problem is the legal uncertainty in the area.

In the long run, however, we believe there will be a solution to both problems. For example, Ethereum 2.0 is likely to provide an adequate response to scalability. The future of legal regulation is a bit questionable in which direction it will develop due to the over-regulation of the financial sector. However, as a long-term economic trend, we believe that if a business function can be implemented with two hundred lines of code without multiple institutional backgrounds, then it will be implemented with two hundred lines of code.