Finance is an art of capital management, whose main goal is to maximize (risk adjusted) asset return. Whether it’s putting money in a deposit account for interest, or investing in stocks or real estate, consumers can use a variety of financial instruments to achieve different goals and avoid all kinds of risks.
Decentralised Finance (also known as defi) has a decentralized back-end architecture, transforming common financial instruments, and its development momentum can not be underestimated. Users no longer need to participate in the financial market with the assistance of centralized institutions, but can use the open source software in the decentralized network to obtain, trade and borrow assets. Therefore, there are many autonomous P2P financial markets, which can not only be open and transparent, but also realize automatic process based on data.
This paper lists the unique infrastructure, products and market structure in the field of profi in detail, and focuses on how developers will use chainlink Oracle to enhance the function and practical application of DFI financial tools.
Overview of the current situation of defi Market
“Defi’s goal is to restructure the global banking system and create an open and non licensing operating environment,” said Alex pack, partner at Dragonfly capital
The current financial system mainly revolves around the issuance of money by the central bank and large banking institutions, which usually act as trusted third parties in transactions. The French currency provides stability to financial markets, and banks tend to borrow heavily, raise interest rates and reduce lending lines in order to increase productivity. Without these two types of institutions to inject liquidity into the market and provide the necessary business infrastructure, the speed of market and innovation will be greatly reduced. However, there are some drawbacks in the current financial market structure. The value and flow of capital are determined by centralized entities, and inefficiency in the process can also have a negative impact. Therefore, the centralized practice will intervene in the market, the channels of capital circulation will be limited, and the contract period will be extended.
With defi, the monetary and banking infrastructure is no longer owned by a centralized entity, but truly belongs to all market participants. In the world of defi, money will no longer be issued by authoritative institutions, and financial networks will no longer run on centralized servers. Money and markets will be run by users themselves through distributed software protocols, which can access reliable network status consensus at any time. The new infrastructure has open source code that can be verified, and no one in the world can access the network without permission. At the same time, the network also adopts a decentralized security mode to ensure that all operations can not be tampered with. Defi not only transfers trust objects from people to code, but also has the potential to achieve huge network effects, because people in any corner of the world can develop or use defi DAPP, which builds a real trust foundation for financial markets.
Details of defi infrastructure
The defi infrastructure consists of several elements, each of which is explained in detail below.
If we want to establish a sound financial market, we must have reliable and universal media to determine the value and complete the value exchange. This medium must be scarce in order to accurately price the market; moreover, it should be universal in order to ensure its long-term value as a general trading medium. Money has been such a medium for a long time. Gold is one of the best media in history. Although the U.S. dollar is considered as the world’s reserve currency, gold has always been a reserve asset in the global market since ancient times, and now central banks still mainly use gold as reserves, and the value of all other currencies will be benchmarked against gold.
Blockchain provides us with a new form of currency. Cryptocurrency is neither physically scarce nor issued by centralized entities. Instead, it is just a software compiled by mathematical algorithms, and its rarity is defined by immutable code logic. Such currencies can be easily traded through distributed consensus and can be verified by everyone in the network. Cryptocurrency not only meets the needs of transactions, but also can be used as a value storage tool (psov) without permission in defi. A psov is similar to a reserve asset that can be collateralized and generate loans similar to those issued by modern banks (though the mortgage rate is much lower than that of traditional banks). Although bitcoin is generally regarded as virtual gold and a reserve asset, the defi ecosystem is rooted in Ethereum, and eth is the main type of mortgage assets. David Hoffman discussed this issue in his article “ether is the best monetary model so far”.
Assets refer to all tangible or intangible goods that can be owned and exchanged for value. There are a variety of assets in the financial market, of which tangible assets include bulk commodities (oil, electricity, food), infrastructure (real estate, machinery, trains) and rare luxury goods (art, cars, collectibles); intangible assets include patents, copyrights and goodwill. Most assets are tracked internally by the parties to the transaction. In addition, banks supporting transactions or government agencies responsible for tax and compliance will also conduct external tracking. In addition, large audit firms value many assets and verify whether internal and external reports match.
Due to the lack of absolute authenticity of the asset market, there is a lot of room for improvement in this system. In the current asset market, there are many accounting systems which are contradictory and can not be disclosed, so it is difficult to consider asset pricing in an all-round way. In the market, the same asset is often valued differently, so both sides of the transaction usually ask a third-party expert to evaluate the difference and determine the final value. Otherwise, both sides of the transaction can only negotiate privately, which often leads to differences or information asymmetry.
Blockchain and smart contract will subvert the foundation of asset ownership and valuation. The emergence of token proves that smart contract can digitize assets by associating the ownership of all assets under the chain with the unique public key / private key on the chain. All types of assets can be represented as tokens, such as real estate ownership, expensive artwork, or goods in the supply chain. What’s unique about blockchain is that it has a completely transparent accounting system and can obtain funds across geographical boundaries, so it is very suitable for registering assets. All parties in the blockchain can trade in a transparent and equal system, which can not only eliminate the friction caused by cross network, but also value the assets based on the real market situation.
Any value transfer can be regarded as a financial product in addition to barter in kind. Whether it is an exchange assisted transaction, or a bank issues (credit or bond) debt, or transfers the ownership of a certain type of asset (such as securities, derivatives, authority), they all belong to a certain trading mechanism or speculative mechanism. Most financial products are issued by large financial institutions such as investment banks. Investment banks have a lot of capital and more resources. These big banks enjoy the advantages of economies of scale, with a lot of capital in their hands to build infrastructure or mortgage to meet liquidity needs.
Defi can turn assets into tokens on the blockchain, and use smart contracts to formulate trading rules and user experience of financial products. The whole life cycle (including ownership, custody, maintenance, execution and delivery) of smart financial contracts can significantly reduce or even completely eliminate human intervention. The trading rules of financial products are written in open source code and fixed in contracts with Boolean logic (that is, if x occurs, y is executed). Some of the most common financial products have been transformed into defi DAPP, including loan products, stable currencies, decentralized exchanges and derivatives.
All financial contracts need data input and output to be executed. Such as sending payments by mouse click, delivering futures contracts based on market data, or calculating bond yields based on current interest rates. Data quality often depends on the reputation of each platform, and some companies provide more accurate and reliable data than others. The value of data usually depends on network effect, uniqueness, authority or quality. Data includes raw data and processing data. At present, financial products are supported by data, but there are usually human intervention or grey areas.
At present, blockchain can only judge true / false based on the existing data on the chain. However, data such as prices, interest rates and event results are often stored off the chain, and the values and formats of different data sources vary greatly. This uncertainty makes it difficult for the blockchain to produce a reliable true / false judgment, unless the consensus security is sacrificed. Due to the irreconcilable contradiction between data and blockchain consensus, we urgently need to build a standardized “bridge” between the defi application and various off chain data. As mentioned earlier, chainlink is a standardized and customizable blockchain protocol, which can connect defi applications to various offline resources safely and reliably.
Chainlink connects the smart contract on any blockchain with any required data interface and covers the entire life cycle of the contract.
Although the goal of defi is to decentralize, it is impossible to completely eliminate the human factor. In the final analysis, the realization and maintenance of the automatic operation of the financial system depends on people. In addition, some areas are almost impossible to automate, especially protocol development and internal governance. Changes in external factors such as politics, culture and legal system will also have an impact on the market. Although distributed ledger Technology (DLT) can realize the automatic operation of the system and be governed by decentralized autonomous organization (DAO), this mode is not mature yet. In fact, human intervention is still unavoidable. This is a problem that developers must face up to, and it is also a problem that they can not completely eliminate with code logic.
Project details in the current defi Market
To fully understand the defi market, it is necessary to clarify the definition of defi. A common measure of the defi market is the amount of mortgage money in the defi app, which is currently around $764 million. This indicator refers to DAPP using virtual currency as collateral (usually ether and Dai) to provide loans, revitalize funds, improve network process security, and obtain voting rights in community governance.
According to https://defipulse.com/ The amount of money (in US dollars) shown for the defi app in the past few months
But you can also say that the whole virtual currency world is a large-scale defi application. In particular, the mainstream virtual currency represented by bitcoin and Ethereum has its own value and can participate in pricing.
Let’s take a look at some of the most common types of defi dapps today, and explore in depth the way these applications are developed and the logic behind them.
So far, the most popular application in the field of defi is makerdao. Makerdao is a decentralized lending platform, which makes credit loans based on Dai and manages the loan process through a decentralized autonomous organization. In the traditional banking industry, banks can make loans as long as they maintain a certain reserve ratio (Note: in the United States, the reserve ratio of banks is 10%, and deposits exceed 124 million dollars). There may be some differences in the specific laws of different regions, but generally all banks need to use 10% of their deposits as reserves, and the remaining 90% can be issued as loans.
The mode of makerdao is similar, but the process is decentralized and the reserve ratio is different. Users of makerdao can mortgage Ethereum in smart contracts and get Dai denominated loan funds. The mortgage rate is currently set at around 150%, which means that users can receive loans equivalent to two-thirds of the value of the mortgage assets. For example, if you mortgage $90000 worth of ether, you can get a Dai loan worth $60000. The loan mortgage rate in this model is higher than that of traditional banks.
It is worth noting that Dai loan products that accept a variety of mortgage types have been launched recently. In addition to Ethereum, users can also mortgage a variety of different types of assets. The logo of this new product is Dai, while the logo of previous single mortgage products is Sai.
Makerdao unifies the incentives of all parties and keeps the network decentralized. MKR pass holders will vote on a variety of system governance issues, such as how to set interest rates and how many loans to make. In return for their hard work, the lender must pay interest using the MKR token. When the price of the mortgaged assets is lower than the clearing price of the assets stipulated in the smart contract, the lender also needs to pay a 14% penalty to the lender. This automatic loan clearing mechanism can automatically hedge against price fluctuations to ensure the solvency of the entire network. Once the loan is fully repaid, the system will automatically destroy the Dai / Sai and a certain proportion of MKR issued before, so as to ensure that the pass becomes more and more scarce over time. The best thing about makerdao is that all users are benefiting the whole network while seeking their own interests, so there is no need for third-party centralized entities to coordinate.
Coindesk’s specific interpretation of makerdao
Another popular defi DAPP is compound. This is a loan agreement that functions with money market fund funds, where users can lend capital to others to earn interest. The lender can obtain corresponding funds according to its “loan ability”, which includes its token balance, market liquidity, exchange rate (Note: connect the price prediction machine to obtain the data), etc. When the loan amount exceeds the loan capacity, the lender will be automatically cleared. Compound can accept seven different mortgage assets, including bat, Dai, ETH, usdc, Rep, Zrx and wbtc.
Compound and maker will eventually completely subvert the traditional banking industry, the main body of lending will change from large financial institutions to retail investors, the mortgage rate of loans and the scale of the credit market will rise sharply, and the new mechanism will automatically avoid the market downward risk. They will lower the barriers to market access and shorten the lending process, where everyone can make loans to earn interest.
We recently had access to AAVE. AAVE, like compound, is a money market defi agreement. Check out our recent blog posts or watch AMA videos for more details.
Another new defi project is synthetix, a decentralized cryptocurrency derivatives platform. Synthetix users can mortgage the platform’s native token SNx (which will be launched soon afterwards) and generate synthetic assets, including French currency, virtual currency, commodities, index and other assets. Traders or investors in these synthetic assets can trade / invest without actually holding the assets. The value of the synthetic asset is also closely related to the market value of the underlying asset in the swap. Synthetix has recently been connected to chainlink network to upgrade its price prediction machine to support synthetic assets containing seven kinds of foreign exchange and commodities. At the same time, the platform is also ready to add more new asset types and improve the level of decentralization.
The composite assets are mortgaged by SNx, with a mortgage rate of 750%. The mortgagor can extract a certain percentage from the transaction fee of the platform for each transaction. Since there is no order book in the synthetic asset swap, the platform trader can have unlimited liquidity. Moreover, users will take on a certain proportion of loans, which will rise or decrease with the proportion of their synthetic assets in the network. Each transaction is executed in accordance with the contract (i.e. SNx mortgage contract). The contract function is similar to the clearing house, which is the counter party of each transaction. All positions in the network are open and transparent. Users can flexibly cope with the situation of high or low risk, fully guarantee that the mortgage rate is at the optimal level, and adjust their positions.
Decentralised exchange (DEX)
Recently, the decentralized exchange has developed rapidly, with kyber network, airswap and uniswap platforms continuously setting new trading volumes. The decentralized exchange provides an unmanaged platform for asset trading, providing users with anti censorship trading experience and different levels of security. For example, users can keep their private keys, while traditional centralized exchanges will keep private keys for users. In addition, X protocol enables DAPP to realize customized decentralized exchange function; BZX protocol can coordinate cross platform unmanaged loan process and provide liquidity for margin trading of decentralized exchange; loopring protocol ensures scalability and privacy of decentralized exchange through offline computing and zkrollups.
Chainlink recently accessed loopring to ensure that the relay mortgaged enough LRC when calculating zero knowledge proof on the chain. For more information, please click on our recent blog post or watch AMA video.
Other defi applications
Other recently popular defi dapps include SET Protocol (automated asset management), August (decentralized forecast market) and lightning network (retail payment in bitcoin). In addition, there are some ICO of token crowdfunding, sto of equity crowdfunding, stable currency, bulk currency (such as ampleforh protocol connected to chainlink network), underlying consensus protocol staging (POS, dpos), and staking in Dao in the form of venture capital fund, insurance fund and protocol governance.
How does chainlink participate in building the next generation of defi applications
Chainlink is a decentralized Oracle network, which can greatly improve the functions of the defi smart contract, enrich the types of the defi products, and attract more participants with higher degree of supervision for the DFI market. Here are four ways in which chainlink can enhance the defi ecosystem.
Resources under the link chain
Most defi applications rely on data to execute smart contracts. Some dapps only use on chain data, so there is no need to connect off chain data. ICO is a typical example. Since the exchange rate has been programmed into the smart contract code, no off chain data is required. Although in some cases only data on the chain is enough, this pattern itself has many limitations, because DAPP must satisfy a specific data format or can only use data on the native blockchain. If you can’t connect external data and resources, most of your defi apps won’t work.
Oracle can connect the smart contract to the data and system outside the native blockchain (i.e. off chain), reformat the external connection point (API), and ensure that the two different software can be compatible when exchanging data. Oracle transfers data to smart contract, and performs operations in external system according to pre-set instructions and interfaces in service agreement (SLA).
Chainlink is a decentralized Oracle network, providing a secure and reliable bridge for smart contracts, connecting to data providers, web APIs, enterprise systems, cloud platforms, Internet of things devices, payment systems and other blockchains. The smart contract is connected with these offline interfaces, which can easily access various pre formatted data input and output, and copy the existing digital contract content. In this way, defi can use all types of off chain data and systems to trigger contract execution, and use various payment gateways and enterprise back-end systems for contract delivery.
The data is credible, reliable and customizable
No matter how smart the smart contract is designed, the final effect depends on the quality of the data received. Contract logic needs to be triggered by data, so the data must be synchronized with the underlying blockchain in terms of security and reliability. Since the Oracle is still a new topic in the field of profi, many projects will develop their own oracle at the beginning. These Oracle machines usually aggregate data off the chain (including interest rate, exchange rate and price data), and then manually transfer the data to the chain. Although it is necessary to do so in order to ensure security in the early stage of project development, the centralized price aggregation will lead to various problems in DAPP management and performance, and the centralized entity managing the data may be bribed to tamper with the data.
Mainstream assets such as Zrx and rep have launched decentralized price reference Oracle networks. After security evaluation, the independent node uploads the price data and finally aggregates it into price reference data. The data will be updated regularly to reflect price changes. You can view our real-time eth / USD and BTC / USD reference contracts on Ethereum main network. The price reference contract provides price data for all DAPP smart contracts, so DAPP does not need to control and maintain the price data, but distributes the control power to the Oracle network with the increasing degree of decentralization.
If you are working on a project called DFI and want to access chainlink and create your own Oracle reference data network, please send an email to [email protected] contact us.
We are working hard to develop a binding agreement (i.e. service agreement) in the chainlink network, where users can agree on the services they need (i.e. data and time limit), the amount of collateral they expect, and their requirements for nodes (minimum reputation threshold and infrastructure), which is not yet available on the main network. The reputation system extracts historical service level data from these service agreements.
All nodes in the network will be listed on platforms such as chainlink market. Users can evaluate and filter nodes that meet their own requirements according to the above dimensions. In addition, the node can also call the data API on the honeycomb API marketplace in a single time without subscribing to all APIs of each data source.
In addition, we also develop data aggregation plug-ins in the service agreement. Users can use multiple Oracle machines to obtain data to achieve computational redundancy; use multiple data sources to ensure data accuracy; and customize data aggregation methods (such as averaging, removing outliers, setting weights, etc.). These functions can enable users to set the decentralization level and data aggregation mode arbitrarily, and connect smart contracts to reliable and accurate data sources.
Another feature under development is town crier, a trusted execution environment (TEE) with Oracle installed. Tee can authenticate TLS certificate and verify whether the data comes from a certain website and whether it has been tampered with during transmission. Assuming that users trust the underlying hardware, town crier can guarantee the authenticity and reliability of user data.
Reduce data and computing costs
Another major problem in the development of defi tools is the cost of gas on the chain. If the application needs to continuously access the price data, or needs to connect multiple Oracle machines and data sources, it may lead to high gas cost and loss of practical value. Decentralization is vital to data security, but this model is difficult to maintain due to its high cost. At present, data is aggregated in the chain, so each Oracle (i.e. node) needs to pay gas fee to transmit external data to the chain. If 10 nodes are used to collect external data, each data update needs to pay 10 gas fees.
We are currently implementing threshold signature technology in chainlink protocol, which is an innovative technology, which can greatly improve the decentralization level of Oracle. Threshold signature technology is an innovative aggregation protocol. Oracle can communicate under the chain, verify data points and reach consensus. The Oracle uses threshold signature technology to aggregate data off the chain. It only needs to send the final result to the chain once and pay a gas fee. The security level is not discounted and can be verified on the chain.
“Our state-of-the-art threshold signature technology requires 15000 gas confirmations,” said lead researcher Alex Coventry of chainlink. In other words, the data transmission cost of $3000 can now be reduced to about $2, which is 1500 times lower. If the quorum of 2000 nodes is verified, at the current gas / eth exchange rate, the cost of the traditional mode is about $17, while the cost of using threshold signature technology is only a little more than 1 cent. “
We are trying to reduce the cost of computing. One of the solutions is to make chainlink Oracle run in trusted execution environment. The combination of trusted execution environment and Oracle can create a closed environment similar to black box, in which nodes can extend the scope of Oracle service to offline computing and transaction privacy protection. Even the Oracle itself can’t see the input and output data. At the same time, trusted hardware can prove to the blockchain that the running process is complete without any tampering. Trusted execution environment has great potential to improve the scalability of smart contract and reduce the computing cost.
In addition to connectivity and low-cost scalability, another major issue is privacy. “Most contracts in the real world have to have privacy protection,” says Sergey Nazarov, co-founder of chainlink In addition to the high cost zero knowledge proof mechanism, there is basically no privacy protection mechanism in the chain, which also means that many contracts can not be transformed into more efficient smart contracts. Privacy protection is indispensable for all parties to hide internal information or transaction strategies. In addition, countries have also issued data privacy protection laws, privacy protection has become a problem that can not be ignored.
Chainlink initially proposed two privacy protection solutions. Developers can choose freely according to their own needs and trust level. As mentioned above, the oracle in a trusted execution environment cannot see the data it collects, so it is impossible to disclose confidential data. Users can also connect to off chain computing environments such as trusted computing framework (TCF) through chainlink.
The latest software solution developed by chainlik is mixicles, which uses Oracle to scramble the data input and output of smart contract to protect user privacy. After receiving the data, the Oracle will judge the data true / false under the chain. Then the judgment results are transmitted to a “mixer”, and the data output is specified based on the data input of Oracle. The basic premise of this scheme is that the state change (i.e., the judgment result) and the data output are decoupled on the blockchain, and they cannot be matched. If a higher level of security is needed, users can access Oracle or Deco in trusted execution environment, and use mixicles to hide the decision results from Oracle. For more information, please read the research paper published by chainlink or blog articles explaining the concept more easily.
The mixicles contract disrupts the data input and output, and has multiple payment data inputs (round 1 and round 2) and multiple new addresses, and distributes the third round of payment data output to multiple addresses.
Bring new customers and new products to the defi ecosystem
There is no doubt that defi is the fastest growing and most demanding market in the field of smart contracts. Although we are very pleased with the development of this field, we must also admit that defi has not been widely used in the offline world. Defi products have great potential and market, can be integrated into the traditional infrastructure off the chain, and reshape the existing financial system. But the premise of all this is that we need to develop new features for smart contracts.
Chainlink is continuously developing practical solutions to address the core issues of smart contracts in terms of connectivity, trusted data, low-cost scalability, and transaction privacy protection, which hinder the further development of difi. If the above solutions can be successfully implemented, then developers can develop the next generation of smart contracts, which can run smoothly in various systems. In the final analysis, chainlink is an open source tool that provides users with customized connection methods to connect to other blockchains or off chain systems, so that all on chain and off chain ecosystems share a common consensus.
Start developing your next generation smart contract today!
If you are a developer or enterprise representative and want to develop your own Oracle to connect the smart contract with external systems, please email to [email protected] , or click to see the chainlink developer documentation, or join our technical discussion on discord. We are ready to provide help and support for you in the process of your Oracle development, to help you develop a safe and efficient customized oracle.
Original text: https://blog.chain.link/analy…
Interested in defi development? Scan the code and join the chainlink developer community!