DIA builds price oracles using Zenlink trade data by following a specific process. The process differs depending on the type of exchange we are referring to, whether it is decentralized finance (DeFi) or non-fungible token (NFT) exchanges.
For DeFi exchanges, DIA engages in data cleaning and outlier detection as the first step. This step ensures that the price estimation process is resilient against trades with prices that deviate significantly from the current market price. Outliers can result from market manipulation, errors, or flash crashes. DIA applies an Interquartile Range (IR) filter to remove outliers and exclude data points outside an acceptable range relative to the interquartile range. This helps in avoiding misaligned price data that can be caused by a single low-volume trade.
The second step involves the application of price determination methodologies. DIA uses trade-based price determination filters to compute a single USD price value for each asset. One example of such a methodology is the Volume Weighted Average Price (VWAP), which considers the different volumes of trades. Another example is the Moving Average with Interquartile Range Filter (MAIR), where trades are ordered by timestamp and grouped into blocks. The weighted average price is then derived from these blocks.
For NFT exchanges, the process of building price oracles is different. DIA determines the floor price of an NFT collection through a two-step approach. Firstly, the on-chain trade data is cleansed using filters to exclude outliers and manipulative techniques. Secondly, a pricing methodology is applied to determine the final price point. DIA offers various methodologies for NFT pricing, including the Floor Price and the Moving Average of Floor Price. These methodologies provide different ways of calculating a collection's value, taking into account factors like lowest sale price and moving averages.
It is worth noting that DIA acknowledges the potential for market manipulation techniques, such as wash trading and sweeping the floor, and implements measures to mitigate their impact on price feeds. DIA's goal is to provide dApps with realistic and reliable price data for NFT collections.
Overall, DIA's process of computing trade data from Zenlink to build price feed oracles involves data cleaning, outlier detection, and the application of specific price determination methodologies, tailored to the type of exchange and asset being considered.