paint-brush
Case Study: How To Achieve A Good On-Chain Solution For Price Feeds Post Mergeby@oraclesummit
117 reads

Case Study: How To Achieve A Good On-Chain Solution For Price Feeds Post Merge

by Blockchain Oracle SummitMarch 13th, 2024
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

0xGorilla, CTO at DeFi Wonderland, presents on the current state of price oracles and the steps to improving them. Price Oracle is a permissionless oracle solution built on Uniswap V3 to provide reliable price quotes on any existing token. Price aims to address the oracle problem by leveraging UnisWap’s decentralization and sustainability while using automation to ensure reliability.
featured image - Case Study: How To Achieve A Good On-Chain Solution For Price Feeds Post Merge
Blockchain Oracle Summit HackerNoon profile picture


In the presentation below, 0xGorilla, CTO at DeFi Wonderland, presented on the current state of price oracles and the steps to improving them.


Below is a glossary of key concepts mentioned during 0xGorilla’s talk, intended as a supplement to his video presentation.

WHAT IS DEFI WONDERLAND?

DeFi Wonderland is a community of developers, researchers, investors, and other DeFi enthusiasts with the collective mission of fostering a decentralized and open financial landscape. The team works with prominent DeFi protocols such as OptimismReflexer, and Connext to push the boundaries of innovation in the DeFi space.

PRICE ORACLE

Price Oracle is a permissionless oracle solution built on Uniswap V3 to provide reliable price quotes on any existing token. The project reduces complexity for users and protocols and removes the trust issues associated with liquidity providers. Price aims to address the oracle problem by leveraging Uniswap’s decentralization and sustainability while using automation to ensure reliability.

CARDINALITY ARRAY

Cardinality arrays are data structures used by price oracles to represent and process multiple price data points from various sources. They enable oracles to efficiently collect and process data, simplify the calculation of Time-Weighted Average Prices (TWAP), and help in the application of statistical analysis on the price history.


To use cardinality arrays, oracles collect data with each element representing a single price data point e.g., the price of an asset at a specific timestamp. Next, the arrays store the data efficiently and the price oracles can now process them into accurate information for smart contracts and dapps. Additionally, cardinality arrays may be synchronized to prevent data inconsistencies.

TWAP (Time-Weighted Average Price) QUERYING

TWAP is the average price of an asset over a specific period, which is adopted by DeFi protocols to avoid price manipulation. TWAP querying refers to the process which provides the TWAP price through average price calculations using data from an oracle or data source.


The first step in TWAP querying is to select the time interval over which the average price will be calculated and then collect price data for the asset at regular intervals during that period. After this, the oracle calculates the weighted average price and performs data validation to check for outliers, data inconsistencies, and potential manipulation attempts. Finally, the Time-Weighted Average Price is obtained as output.

SPOT PRICE

Spot price represents the immediate value of an asset in the market without accounting for any future changes. In DeFi where prices are volatile and prone to manipulation, oracles avoid returning the current spot price. Instead, oracles use price-averaging methods like Time-Weighted Average Price (TWAP), Volume-Weighted Average Price (VWAP), Simple Moving Average (SMA), and many others to provide stable and manipulation-resistant reference prices. More information about TWAP and VWAP algorithms can be found in this article by Chainlink.


Learn more about DeFi Wonderland here:


Wonderland Website
Wonderland GitHub
Wonderland Twitter
0xGorilla Twitter
Price Oracle Documentation


The Blockchain Oracle Summit is the world’s only technical summit that dives deep into the use cases, limitations, and impacts of oracles on the wider blockchain ecosystem. Leading speakers worldwide gathered in Paris to share their work and experience building and using oracle solutions. Article by Michael Abiodun.


Also appears here.