When it comes to building price oracles with Beets trade data, DIA follows a specific process depending on the type of exchange being referred to, whether it's DeFi or NFT.
For DeFi exchanges, DIA begins by cleaning and detecting outliers in the trade data. This is crucial to ensure that the price estimation process is resilient against irregularities such as market manipulation or flash crashes. The data points that fall outside an acceptable range, as determined by an Interquartile Range (IR) filter, are excluded. Only the trades falling within the middle quartiles are retained for further processing.
To calculate the final price, DIA applies trade-based price determination methodologies. One example is the Volume Weighted Average Price (VWAP), which considers the different volumes of trades. All trades from a specific time range are weighted by their volume, and the accumulated volume-price-products are divided by the sum of all volumes combined to obtain the final price.
On the other hand, for NFT exchanges, DIA takes a different approach to determine the floor price. The on-chain trade data is first subjected to cleansing filters to exclude outliers and manipulation techniques. Then, a pricing methodology is applied. The simplest mechanism is the Floor Price, which provides the lowest sale price recorded on the blockchain within a given time window. However, this method is susceptible to manipulation.
To provide more reliable NFT floor prices, DIA offers advanced methodologies such as the Moving Average of Floor Price. This calculates the moving average of a collection's floor price, with customizable parameters for specific use cases. An interquartile range outlier detection filter is also applied to filter out malicious behavior like wash trading.
DIA is open to discussing custom filters and methodologies to cater to specific use cases beyond the implemented techniques mentioned above. Their aim is to provide realistic and reliable price data for various applications in the blockchain ecosystem.