Pricing methodologies

This section covers the methodology of how DIA gets and calculates prices for cryptocurrency assets.

Initial Trade Collection

First and foremost, trades are collected in real-time, from both Centralized (CEX) and Decentralized (DEX) exchanges using exchange scrapers. The complete list of supported exchanges can be accessed here. DIA primarily records trades involving pairs of crypto assets, although a minority of trades against fiat currencies are also captured from CEXes.

Data Cleansing

After the trades are collected, a data cleansing process is initiated to exclude outlier non-market representative trades, leading more accurate pricing later on. This involves applying filters such as calculating the volume ratio between the traded assets and evaluating liquidity data from DEX pools. Outliers are cleared using the Interquartile Range Filter methodology.

Price Estimation in USD

DIA standardizes all asset prices in USD, even for those assets that are primarily traded in crypto-to-crypto pairs. To accomplish this, DIA employs a price estimator, which is continually updated with each new recorded trade. Each trade is composed of a base token and a quote token. The price of the quote token is denominated in base tokens.

Under certain conditions, such as when both traded assets are crypto tokens, the quote token may also serve as a base token for price estimation. Importantly, USD is always designated as the base token for consistency.

Time-based Trade Block Storage

The cleansed trades are organized into time-based blocks, specific to each asset (i.e 120 seconds). Trades within these blocks are considered for the price evaluation process later on. However, the actual price determination may vary depending on the chosen filter methodology, ensuring that only the most representative trades are used to calculate the most precise market price.

Price Determination Filtering

Each of the time-based blocks undergoes a series of filter calculations. A filter derives a singular price point from a block's trades. For instance, the Moving Average filter provides the volume-weighted average for the block.

Each asset's filters are computed both per exchange and across all exchanges. The latter gives the closest approximation to the true "whole market" as gauged by this system.

Various use cases might require different filters, and DIA offers a selection for these needs. New ones can also be added on demand.

Last updated