When building price oracles with DFYN trade data, DIA follows a specific process depending on the type of exchange we are referring to.
For DeFi exchanges, DIA first performs data cleaning and outlier detection. This step ensures that trades with prices diverting from the current market price, possibly due to market manipulation or errors, are excluded. DIA applies an Interquartile Range (IR) filter to remove data points and sets that lie outside an acceptable range relative to the interquartile range. Only trades falling into the "middle" quartiles move forward for further processing.
Next, DIA applies price determination methodologies to calculate the final price from the remaining data points. One example is the Volume Weighted Average Price (VWAP) methodology, which considers the different volumes of trades. All trades from the queried time range are weighted by their volume, and the weighted average price is calculated.
For NFT exchanges, DIA uses a different approach to determine the floor price of an NFT collection. The on-chain trade data is first processed through cleansing filters to exclude outliers and manipulation techniques. Then, a pricing methodology is applied to determine the final price point.
The simplest methodology provided by DIA is the Floor Price, which represents the lowest sale price of an NFT collection recorded on the blockchain during a given time window. However, this method can be manipulated by malicious market actors through techniques like wash trading and floor sweeping.
To combat manipulation, DIA offers advanced methodologies such as the Moving Average of Floor Price, which returns the moving average of a collection's floor price. It also applies an interquartile range outlier detection filter to filter out malicious behavior.
DIA is open to discussing custom filters and methodologies for specific use cases to ensure more realistic and reliable NFT floor prices.