Price prediction machine: an indispensable infrastructure

Price prediction machine: an indispensable infrastructure

Loading

With the development of the DeFi ecosystem, DeFi 1.0 has been unable to meet the needs of the market. We need DeFi 2.0, which is CoFi (Computable Finance).

Overview

With the development of the decentralized financial ecological environment in the past year and the recent positive market trends, we have observed that in the past three months, the market has been shifting from a centralized financial system to a decentralized financial system.

However, there is still a long way to go before decentralized finance finally reaches the innovation of traditional finance and make it more efficient and transparent. The problem of oracles is one of the obstacles hindering the development of decentralized finance.

Price prediction machine: an indispensable infrastructure

Decentralized applications (DApps) cannot directly interact with off-chain data for application innovation, which is one of the core problems of the blockchain world. The emergence of price oracles may solve this problem and promote the development of a decentralized financial system. The price predictor is an interface connecting the world on the chain and the world off the chain.

If there is no price oracle machine, the blockchain itself will be difficult to communicate and interact with the non-blockchain world, thereby limiting its application and innovation potential. This is the important significance of the existence of the price oracle machine.

Existing mainstream decentralized financial service platforms (such as MakerDao, Compound, dYdX, etc.) have a strong dependence on oracles. These decentralized financial service platforms need to obtain stable and reliable data from oracles. Therefore, the oracle is an indispensable infrastructure in the decentralized financial system.

risk

Decentralized finance is quite different from traditional finance, including the following points.

Difficulty in risk management

In traditional finance, whether it is investing, trading, or holding a position, risk is always given priority.

Quantifiable risk indicators can help market participants make relatively correct decisions. But in the field of decentralized finance, it is difficult for us to conduct risk analysis, and it is even more difficult for us to quantify risk factors for specific products. In other words, in the current market environment, market participants cannot fully understand the risks of decentralized finance, nor can they conduct risk hedging .

The time of the blockchain is not continuous, but is timed by blocks

In the off-chain world, time is a continuity indicator, and the market has a price discovery mechanism based on continuous time. Therefore, price discovery in a centralized market is more efficient than a decentralized market. However, the smallest unit of time on the chain is a block.

Due to the different time structure, we believe that decentralized finance should not use the same price discovery mechanism as centralized finance. Decentralized finance should give full play to its unique advantages, but the current decentralized financial market is based on centralized thinking.

Existing automated market makers (AMMs) rely on arbitrageurs to maintain price accuracy

Traditional financial markets have become relatively efficient after long-term development, and arbitrage opportunities are very rare. However, the current decentralized exchanges based on automated market rely heavily on arbitrage to achieve price accuracy, making their infrastructure relatively imperfect.

Liquidity providers (LPs) of risky assets cannot obtain sufficient risk compensation

Friction costs (such as handling fees and delay costs) cannot be ignored in traditional finance. These friction costs still exist in decentralized finance, and it is difficult for liquidity providers to obtain sufficient compensation to make up for the losses caused by these friction costs.

Considering the above factors, we believe that the blockchain infrastructure, especially the oracle system, should follow the following design principles.

  • Able to quantify risks;
  • Use block as the minimum time unit instead of continuous time;
  • Able to operate without arbitrage;
  • Compensation for friction costs such as delays and handling fees of liquidity providers.

Oracle

The oracle is an important part of the decentralized world. Its function is to connect the data of the world on the chain and the world off the chain, and to assign value to these data.

As shown in the figure below, from May 1, 2020 to September 1, 2020, the 30-day rolling gas consumption of Chainlink (an oracle project) increased by 32.2 times , while the average gas consumption of the entire network only increased 26.9 times.

价格预言机:一种不可或缺的基础设施 Chainlink and the entire network average 30-day rolling gas consumption, source: ETH Gas Station

Chainlink and NEST Protocol (another oracle project) in 2020. September 1st Place into the Ethernet network-wide Gas consumption in the top ten, respectively ranked fifth and seventh. Chainlink only ranked 11th on May 1 of the same year, and NEST Protocol did not enter the list.

价格预言机:一种不可或缺的基础设施 Ethereum gas consumption distribution, source: ETH Gas Station

Gas consumption distribution also shows that NEST Protocol and Chainlink are the only non-decentralized exchange (DEX) projects in the top ten of Ethereum Gas consumption list (except Tether USD and SmartWay Forsage, among which SmartWay Forsage is a Ponzi scam).

Different from the crazy annualized return rate of liquidity mining, the oracle project is more down to earth, especially the NEST Protocol. The Google search index shows that the search interest of oracle keywords was zero 80% of the past 90 days. Compared with the recent development of decentralized finance, this desertedness means that the oracle sector still has a lot of room for development.

价格预言机:一种不可或缺的基础设施 Google search popularity comparison: DeFi and oracles, source: Google Trend

Introduction to oracles

The oracle sector can be roughly divided into two categories, namely , centralized oracles and decentralized oracles . Among them, Coinbase oracle is a representative of centralized oracle. The oracle uses the Coinbase Pro trading API as the source of price data and eliminates abnormal data. Decentralized financial projects can use Coinbase oracles and use public keys for source verification. Although centralized oracles are a simple solution for data on-chain, for security reasons, most decentralized financial projects do not use such oracles. The reason is that attackers can maliciously manipulate the single data source of such oracles and broadcast it to the entire network, thereby affecting the decentralized protocols that rely on these oracles.

Decentralized oracles are widely accepted by the decentralized financial ecosystem, and lending and derivatives platforms are major users of decentralized oracles.

价格预言机:一种不可或缺的基础设施 The lock-up amount (TVL) carried by different oracles, source: DeFi Pulse

This chapter mainly analyzes four decentralized oracle projects, namely Chainlink, NEST Protocol, Band Protocol and Tellor . These four oracles follow different design principles and have different degrees of decentralization.

Chainlink provides price feeds for 55 trading pairs, including 30 legal currency trading pairs. As of September 14, 2020, more than 2.3 billion US dollars of lock-up funds are dependent (or partly dependent) on Chainlink.

Band Protocol aims to provide price-feeding services to multiple public chains (including Ethereum, Polkadot and Cosmos). In addition to digital assets, Band Protocol can also connect to various trusted data sources, such as weather, lottery tickets, and unemployment rates through APIs and customized scripts.

Tellor combines the traditional proof-of-work mechanism with the concept of staking to ensure data quality. Users can use TRB as incentive request data, and the smart contract will allocate the highest incentive data application to miners based on the number of incentives, and then miners will compete for workload. The median of the first 5 data that is calculated and submitted will be recorded on the chain and used as a feed price.

In general, the above three adopt the data chain solution shown in the figure below.

价格预言机:一种不可或缺的基础设施 Data on-chain solutions for conventional decentralized oracles

Generally, on-chain verification requires voting through transactions. This process consumes a lot of Gas when the network is blocked (or when the market fluctuates sharply), and the possibility of transaction failure exists. Limited by the need for data verification on the chain, the above three oracles may fail to feed prices when the market becomes irrational.

The difference is that NEST Protocol uses a new incentive method to carry out the process of decentralized data on-chain, which is called quotation mining . In quotation mining, market participants are divided into Makers and Callers. Anyone can pay the commission for quotation mining and obtain NEST tokens. If the quotation does not match the market price, the challenger can double pledge, update the price and make a profit.

At present, every decentralized financial project puts a module of the traditional financial system to run on a smart contract, and the lending module has the highest total lock-up volume. However, according to CoinGecko data calculations, the total market value of the top 100 digital asset projects is about 328 billion U.S. dollars, of which 22% of the market value has not yet been fed by decentralized oracles.

价格预言机:一种不可或缺的基础设施 The total lock-up amount of different DeFi function modules, source: DeFi Pulse

One of the original intentions for the construction of a decentralized financial system is non-discrimination. It should avoid only providing services to tokens with extremely rich liquidity and not lending to tokens with small market value. However, without proper economic incentives, even decentralized oracles cannot meet the price feed requirements of hundreds of trading pairs at the same time.

The decentralized financial ecosystem should not fix the types of oracles quoted assets, and which assets can be quoted should be determined by the community. However, the quotes of long-tail assets are often vulnerable to attack. The punishment for malicious bidders is limited to the assets pledged in the oracle system, and is much lower than the total amount of assets relying on the oracle, so that malicious bidders can be profitable. NEST Protocol makes it difficult to make malicious quotations. If a malicious quote is made on NEST Protocol, unless the quoter continues to double pledge to maintain the quote, it will expose a lot of arbitrage space. The cost of malicious quotations for assets will exceed the current total supply of ETH within one hour. Therefore, NEST Protocol is resistant to malicious quotations .

Feed price comparison

One of the main responsibilities of the oracle is to feed prices. The picture below shows the market value of the current oracle supporting the price of digital assets.

价格预言机:一种不可或缺的基础设施 The current oracle machine supports the market value of digital asset price feed, source: CoinGecko

Chainlink nodes need to pledge LINK tokens to upload data. Although it is officially stated that any organization or individual can run Chainlink nodes, the Reference Data Feed system currently still needs to be approved and has a high degree of centralization. Chainlink’s ETH-USD trading pair currently has 21 trust nodes, and the price feed frequency is 0.5% price changes.

In Tellor, users can use TRB incentives to apply for price feeds. The prices of the 5 first completed workload competitions will be taken as the median, and users can dispute the prices within a day.

NEST Protocol allows miners to quote tokens through pledge quotation transactions. For example, staking 10 ETH and 3,800 USDT at the same time means that the miner’s price for ETH is $380/ETH. When the quotation is incorrect, the arbitrageur can buy any side of the token pledged by the quotation miner within 25 blocks (currently about 5 minutes) to correct the price .

If the quote is not challenged within 25 blocks , it means that the quote cannot be arbitraged; the quote will be used by NEST Protocol downstream DeFi applications. There is no similar verification process in other oracles, so other oracles cannot guarantee that their quotations cannot be arbitraged.

In addition, NEST Protocol can reach a quote for each block. Since the time on the chain is composed of blocks, the quotation efficiency is the highest efficiency.

价格预言机:一种不可或缺的基础设施 The price comparison of different decentralized oracles

Unique risk factor value proposition

Price delay and price deviation (volatility) are risk factors that must be faced when quoting an oracle machine. Factors such as network congestion and lack of price feeds will cause price delays, leading to price deviations. These two risk factors greatly affect the overall performance of the DeFi protocol that relies on oracle price feed.

Because the chain uses continuous time timing, and the chain uses discrete block timing, the delay and deviation of quotes on the chain cannot be perfectly eliminated. Nevertheless, we can try to quantify the two risk factors to further explore more possibilities in the DeFi ecosystem.

As a bridge between on-chain and off-chain data, the importance of oracles is self-evident. However, due to the design of the oracle machine and the problems of the blockchain itself, after the asset price is transmitted from the chain to the chain through the oracle machine, there is a difference in the price of the asset from the chain. And the longer the delay, the greater the volatility, the greater the price difference.

In fact, during the transfer of asset prices from off-chain to on-chain, three prices with smaller differences will be generated: exchange quotations, oracle theoretical price feeds, and on-chain quotations . Behind the difference between these three prices are two overlooked risk factors: delay and price volatility .

价格预言机:一种不可或缺的基础设施 Explanation of price deviation between on-chain and off-chain

Delay and fluctuation

价格预言机:一种不可或缺的基础设施

All oracle machines have delays, and the risk factors that cause price fluctuations are difficult to ignore. Since the on-chain and off-chain operations adopt different time structures (discrete block timing and continuous timing), time is prone to delay, and there will naturally be price differences between on-chain and off-chain. Moreover, when the market fluctuates greatly, greater price deviations are more likely to occur.

data analysis

This report compares the quotations of NEST Protocol and Chainlink oracles based on ETH/USDT. Huobi Global exchange quotes are selected for off-chain data. The data time range is selected from August 30 to September 16, 2020.

The following left figure analyzes the ETH/USDT quotations and off-chain data of NEST Protocol and Chainlink. The prices reported by the two oracles are almost equal to the distribution of off-chain data, with only slight differences. The picture on the right below is a moving average price chart with a moving window of 1440 minutes. The three curves basically overlap.

价格预言机:一种不可或缺的基础设施

The picture below shows the deviation distribution of the price difference between the oracle quotation and the off-chain price. It can be seen that the spread of the NEST protocol (red dot) is smaller than that of Chainlink (blue dot). In addition, the statistical analysis results of the spread show that the absolute value of the Chainlink average spread is $0.494, which is 31 times the absolute value of the NEST protocol average spread ($-0.016). In contrast, the NEST protocol quotation is more accurate than Chainlink.

价格预言机:一种不可或缺的基础设施 Spread deviation analysis

The above figure shows that the quotations of the two oracles from September 2 to 6 have a large price difference with the off-chain price. During this period, the market also changed drastically: first, the price of ETH/USDT dropped significantly, and second, the gas cost of the Ethereum network on September 2 was higher than usual, reaching a high of 480Gwei. Therefore, to a certain extent, the accuracy of the oracle quotation is affected by market performance.

价格预言机:一种不可或缺的基础设施 Ethereum network gas cost chart (Gwei), source: etherscan

The following figure shows the moving average standard deviation of the spread (with a daily moving window of 1440 minutes). The figure shows that the moving average standard deviation of the spread between the NEST protocol quotation and the off-chain price is only 0.21% to 1.3%, while Chainlink reaches 0.97. % To 2.01%, higher than NEST.

价格预言机:一种不可或缺的基础设施 Moving average standard deviation analysis

In the previous analysis, different oracles will produce significant price differences when the off-chain price fluctuates greatly. This report further compares the accurate quotations of oracles in different price fluctuation markets. The figure below shows the analysis results on September 5 and September 14. The difference between the maximum and minimum price of ETH/USDT on the Huobi Global exchange on September 5 was $76. On the same day, the difference between the NEST agreement and Chainlink’s quotation and the off-chain price reached the maximum deviation. On the other hand, September 14 represents a market situation with relatively small price fluctuations in the off-chain market.

The figure below shows that the number of quotations (red) provided by Chainlink is significantly smaller than the quotations provided by the NEST protocol. And it is especially obvious on September 14 when the market price fluctuates greatly. This is due to the Chainlink oracle’s own design, which causes its quotation frequency to be slightly lower than that of the NEST oracle.

价格预言机:一种不可或缺的基础设施 ETH/USDT price on September 5 and 14, 2020

The Chainlink oracle only updates quotes in two situations. One is that the price volatility under the chain exceeds 0.5%, and the other is that the price volatility under the chain has been below 0.5% for 10800 seconds. The NEST protocol allows any miner to provide a quote to earn NEST tokens.

The results of the deviation between the NEST agreement, Chainlink oracle quotation and off-chain price during these two days are shown in the following figure. In the case of large market price fluctuations on September 5, the oracle quotation deviated by more than $10. In the case of small market price fluctuations on September 14, the deviation of the oracle quotation was less than $5. It can be seen that the price volatility in the off-chain market aggravated the deviation between the oracle quotation and the off-chain price.

价格预言机:一种不可或缺的基础设施 Comparative analysis of spreads on September 5 and 14, 2020

In addition, under the same market price fluctuations, the NEST protocol can provide more accurate quotations than Chainlink.

Through the analysis and comparison of multiple perspectives in this report, since NEST Protocol can provide more frequent and accurate quotations, NEST Protocol is far more capable of Chainlink as an oracle.

what does this mean?

Although we have seen the community’s efforts for decentralization, innovation, and indiscrimination, the current decentralized financial ecosystem is still a centralized financial system running on the blockchain. We believe that the current decentralized financial system can be called DeFi 1.0. Some sections of the decentralized financial blueprint, such as lending, trading, and oracles, have had certain early developments in the past few years.

This article shows that the oracle has room for further decentralization and improved reliability. Chainlink and some other participants connect the blockchain world and the real world, but compared to NEST Protocol, its accuracy and degree of decentralization should be questioned.

With the development of the decentralized financial ecosystem, DeFi 1.0 has been unable to meet the needs of the market, especially for those experienced market participants. Therefore, we need DeFi 2.0, which is CoFi (Computable Finance).

The oracle can partially solve the problem that the current decentralized financial ecosystem is difficult to carry out risk calculation. Ultimately, the decentralized financial market will allow participants to quantify their risk factors, and obtain compensation or appropriate methods for hedging.

As far as CoFi is concerned, we need to build this ecosystem from the ground up, starting with the oracle. So that the market can be more attractive and provide more accurate and timely information.

Disclosure: Huobi DeFi Labs provided financial support to CoFiX , which is a community-driven DeFi protocol based on NEST Oracle.

references:

[1] Uniswap v2 Core

[2] Bancor Protocol

[3] The Math Behind PMM

[4] NEST Protocol

[5] How Accurate the NEST Price Is

[6] Trading Compensation of CoFiX

[7] CoFiX Product Documentation