DIA Nexus Documentation
  • Nexus Overview
  • Intro to Nexus
    • How it works
    • Nexus vs. Lumina
    • Integrated Chains
  • Data products
    • Token Price Feeds
    • RWA Price Feeds
    • Randomness
    • Fair-value Feeds
  • How-to Guides
    • Fetch Price Data
      • Solidity
      • Vyper
      • Demo Oracles
      • Chain-specific Guide
        • Aleph Zero
        • Alephium
        • Edu Chain
        • Hydration
        • Kadena
        • LUKSO
        • Somnia
        • Stacks
        • Superseed
        • XRP Ledger (XRPL)
    • Generate Randomness
      • Solidity
      • WASM
      • Demo Oracles
      • Chain-specific Guide
        • Alephium
    • Migrate to DIA
    • Fund the Oracle
    • Build a Scraper
      • Development Cluster Stack
      • DIA Test‐Space with Docker Compose
      • DIA Test‐Space with Minikube
      • Add a new exchange scraper
      • Add a new foreign scraper
      • Add a new liquidity scraper
      • Additional notes
  • Request a Custom Oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • APIs
      • Token prices
        • RestAPI
          • Request Samples
        • GraphQL
          • Request Samples
      • RWA prices
    • Pricing Methodologies
      • IR: Interquartile Range Filter
      • MAIR: Moving Average with Interquartile Range Filter
      • VWAP: Volume Weighted Average Price
      • VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
      • LST fair price
    • Data Sources
      • CEXes Data
      • DEXes Data
    • Smart Contracts
      • DIAOracleV2.sol
      • DIARandomOracle.sol
    • Randomness Protocol
  • Resources
    • Audits
    • Community & Support
    • Security Bounty Program
    • Research
      • Return Rates in Crypto Farming
      • Crypto Volatility Index
      • Compounded Rates
      • Polkadot Medianizer
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • Outliers and Market Manipulation
  • Data Preprocessing
  • Advanced Filtering
Export as PDF
  1. Reference
  2. Pricing Methodologies

IR: Interquartile Range Filter

This section describes how we filter for outliers in ourprice determination system.

PreviousPricing MethodologiesNextMAIR: Moving Average with Interquartile Range Filter

Last updated 1 month ago

Outliers and Market Manipulation

The price estimation process needs to be robust against trades with prices that are diverting from the current market price of an asset pair. Reasons for diverting trades can be market manipulation, errors, flash crashes on certain exchanges, or other market irregularities.

Detecting and excluding outliers and market manipulation is an important data processing task, especially in small and (somewhat) intransparent markets. Otherwise, a single low-volume trade can offset the price estimation and serve as a base token for other assets, leading to a chain reaction of misaligned price data.

We calculate our cryptocurrency spot-prices using 120-second moving average (SMA) with a weighting of trade volumes (VWAP). Small volume trades have a proportionally smaller influence on the determined price than bigger volume trades. In order to create reliable pricing, we also exclude data points and sets entirely that lie outside of an relative to the of all data points.

Data Preprocessing

The Interquartile Range filter in DIA examined all trades in a trades block (i.e. all trades in the predefined time range) and sorts them by their recorded price.

After that, this range of prices is divided into four price blocks, the Quartiles. The boundaries of the full price range also determine the boundaries of the first and the last quartile.

To clear out outliers, any trades falling into the first or the last quartile are filtered out and subsequently, only trades falling into the "middle" quartiles are returned to the caller.

Advanced Filtering

After this clearing process is finished, the data is ready to be processed further in other filters like the or filter.

acceptable range
interquartile range
Moving Average
Volume Weighted Average Price