In the presentation below, 0xGorilla, CTO at
Below is a glossary of key concepts mentioned during 0xGorilla’s talk, intended as a supplement to his video presentation.
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 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 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
Learn more about DeFi Wonderland here:
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
Also appears here.