NEST oracle adds average price and volatility data to meet real needs

avatar
NEST爱好者
3 years ago
This article is approximately 1568 words,and reading the entire article takes about 2 minutes
An economic system, no matter what the mechanism is, if it cannot capture and create value, it will die.

Author | Blockchain Financial Analyst. Matlif

Produced | NEST Fans (nestfans.com) has been authorized by the author to publish

NEST Protocol was successfully upgraded to version 3.5 on January 20, 2021. After the upgrade, the NEST oracle system added two output data: moving average price and volatility. For the caller of the downstream contract, each call will get 3 data: real-time price, moving average price, and volatility, but the call fee of the caller has not increased and remains unchanged.

Charts 1 and 2 are real-time price, moving average price and volatility charts recently provided by NEST v3.5. The addition of volatility and average price indicators to the NEST v3.5 system is an important adjustment made by the NestCore developer team with the support of the community to meet the authenticity needs of downstream DeFi for oracle machines. Let’s analyze NEST in detail below. V3.5 introduces the significance of average price and volatility oracles.

First of all, let us understand the concept of average price and volatility and the calculation formula of average price and volatility of NEST v3.5.

Chart 1: Real-time price and moving average price (ETH-USDT) provided by NEST v3.5

NEST oracle adds average price and volatility data to meet real needsData source: Etherscan block explorer

Chart 2: Volatility provided by NEST v3.5 (ETH-USDT)

NEST oracle adds average price and volatility data to meet real needssecondary title

1. Basic concepts

1.1 Volatility

Volatility is a statistical concept, which is mainly used to measure the intensity of price fluctuations of underlying assets. It is a measure of the uncertainty of asset returns and is used to reflect the risk level of assets. The higher the volatility, the more volatile the asset price. The greater the volatility, the stronger the uncertainty of the return on assets; the lower the volatility, the smoother the fluctuation of financial asset prices, and the stronger the certainty of the return on assets. Under different standards, volatility can be classified differently. According to different calculation methods and applications of volatility, volatility can be divided into: implied volatility, historical volatility, realized volatility (high frequency volatility/intraday volatility rate), actual volatility, expected volatility, etc.

1.2 Moving average price

secondary title

2. Calculation and measurement

2.1 Calculation and measurement of volatility

Since the price is a random process, the actual volatility is always an unknown. In other words, the actual volatility cannot be accurately calculated in advance, and people can only obtain its estimated value through various methods, which is similar to the overall parameter in statistics The concept of overall parameters is generally unknown and needs to be estimated through sample statistics. The standard deviation of prices is the simplest and most common volatility statistic. At the same time, the choice of samples and time periods have a greater impact on volatility.

Considering the calculation cost on the chain, we use an exponential smoothing (or weighted) moving average model to calculate the volatility of NESTs valid quotes. The influence of variable values ​​with a relatively long time is relatively low, and the influence of variable values ​​with a relatively recent time is relatively high. The calculation of the volatility by the exponential smoothing method needs to keep the previous (t-1) volatility value and the last two consecutive price data, and the operation is relatively simple, which is a good way to reduce memory space and gas consumption way of doing. The specific calculation method of the volatility index provided by NEST v3.5 is as follows.

Assume that the NEST oracle block price obeys the geometric Brownian motion model or the logarithmic return of the asset price obeys the geometric Brownian motion model. set up:

NEST oracle adds average price and volatility data to meet real needs

in:

NEST oracle adds average price and volatility data to meet real needs

in:

NEST oracle adds average price and volatility data to meet real needs

Because NESTs effective quotation has a block interval, the above formula can be adjusted to:

NEST oracle adds average price and volatility data to meet real needs

NEST oracle adds average price and volatility data to meet real needs

Based on this weight calculation, the latest 50 volatility accounts for more than 90% of the weight, and the influence of each value decreases exponentially with time. The closer the time is to the current moment, the greater the influence of the data. σ is the volatility we output index of.

2.2 Calculation and measurement of moving average price

Common moving averages include simple moving average, weighted moving average and exponential smoothing moving average, etc. The main difference between them is the formula for calculating the average. The simple moving average is to use all the past data of the time series in a certain period of time equally (with the same weight). The weighted moving average gives more weight to the recent price, and a smaller weight to the long-term price. The exponential smoothing rule is compatible with the simple moving average and the moving average, and does not discard the past data, but only gives a gradually weakening influence, that is, as the data moves away, it gives a weight that gradually converges to zero.

secondary title

NEST oracle adds average price and volatility data to meet real needs

NEST oracle adds average price and volatility data to meet real needs

3. Application and Significance

3.1 Application and Significance of Volatility

1) Volatility is one of the most critical parameters for derivatives pricing. For derivative financial instruments, whether it is an option or a more complex financial derivative, the price volatility of the underlying (or underlying asset) is an important factor affecting the price of the derivative, such as the most famous Black-Scholes (Black-Scholes) option pricing model (Chart 3), which represents the volatility of the underlying, which is one of the important factors affecting option prices (Chart 4), so for downstream DeFi option projects (such as Deribit, Hegic , Opyn, Primitive, etc.), volatility is rigid demand data for them.

Figure 3: Black-Scholes option pricing formula

NEST oracle adds average price and volatility data to meet real needs

Chart 4: Factors Affecting Option Prices

NEST oracle adds average price and volatility data to meet real needs

2) Volatility is also one of the most critical parameters of risk management techniques. Volatility is the standard deviation of expected returns, which reflects the risk level of assets and is a measure of risk. And we know that all decentralized financial activities (lending, asset trading, asset management, etc.) are centered on managing and dealing with risks. All DeFi projects must have risk control, anticipating market fluctuations or avoiding risks. Volatility is not an option. missing indicators. For example, for downstream DeFi lending projects (AAVE, Compound, etc.), due to the extreme volatility of mortgage assets, the formulation and selection of mortgage rates or liquidation lines is extremely important, which determines the degree of risk of the project and at the same time determines the utilization rate of user assets , the most important indicator to be considered in the formulation and selection of the optimal mortgage rate or liquidation line is the volatility of the asset. For example, the mortgage asset is USDT, and its price volatility is small, so the mortgage rate and liquidation line should be lower. If the mortgage asset It is NEST, and its volatility is higher, so the mortgage rate and liquidation line will be higher. Similarly, for digital asset-backed stablecoin projects (such as MakerDAO, QIAN, etc.) and parallel asset projects planned by the NEST community, the formulation and selection of important parameters (mortgage rate, liquidation line, stability fee, etc.) are also inseparable from volatility Indicators, such as the QIAN stablecoin project, whose start-up adequacy ratio formula only depends on the calculated real-time volatility, and set up an automatic adjustment mechanism based on the volatility to find the best balance between user asset utilization and liquidation risk. It is understood that the mortgage rate and liquidation line of NEST ecological parallel asset projects in the future will also largely depend on the volatility of mortgage assets.

3) DeFi financial products can be directly designed based on volatility, such as volatility futures, volatility swaps, etc. Volatility trading refers to transactions based on the analysis and prediction of volatility, which weakens the impact of price changes on strategies , mainly relying on the volatility itself or the form of volatility behind the volatility to obtain profits, has its unique appeal and great market demand, but there is currently no financial product protocol based on volatility in the DeFi market.

3.2 Application and Significance of Moving Average Price

1) For some DeFi projects that do not require high real-time prices, they prefer to use average prices instead of real-time prices, because the values ​​of real-time price time series are affected by periodic changes and irregular changes, and fluctuate greatly , It is not easy to show the development trend, and the average price can eliminate the influence of these factors, and the average price may sometimes reflect the supply and demand relationship of the market more accurately. For example, it may be more reasonable and fair to use the average price to liquidate mortgage assets. For example, the recent popular perpetual contract project Perpetual Protocol, the source of its index price is the time-weighted average price (TWAP) provided by the oracle.

2) For NEST oracles, moving average price oracles are more resistant to oracle manipulation attacks than real-time price oracles, so DeFi projects that require higher price resistance to attack can use average prices.

3) In fact, the current second largest oracle machine Uniswap price oracle system provides time-weighted average price (TWAP) instead of real-time price data.

4) The average price can also be used to exclude abnormal price data. According to the price data provided by the NEST oracle machine, the probability of the price deviation being higher or lower than 2.5% is only 0.19%. So the formula can be used:

NEST oracle adds average price and volatility data to meet real needs

To limit the value range of normal prices and to exclude abnormal price data.

3.3 Summary

After NEST Protocol was upgraded to version 3.5, moving average price and volatility oracles were introduced for use by developers on the chain. It was NEST developers who, after in-depth thinking and research, met downstream DeFi’s authenticity needs for oracles. An important upgrade iteration of NEST Protocol is essentially a necessary choice for NEST to meet the needs.

Original article, author:NEST爱好者。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks