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
  • Trade Collection
  • Price Calculation
  • Filter Application
  • Implementation
Export as PDF
  1. Reference
  2. Pricing Methodologies

VWAP: Volume Weighted Average Price

This page contains information about the VWAP pricing methodology.

PreviousMAIR: Moving Average with Interquartile Range FilterNextVWAPIR: Volume Weighted Average Price with Interquartile Range Filter

Last updated 1 month ago

VWAP (Volume Weighted Average Price) is a methodology for trade-based price determination that takes into account the different volumes of trades.

Trade Collection

All trades from the queried time range are collected and weighted by their volume. Weighting means that the (normalized) volume of the trade is multiplied by its executed price.

Price Calculation

As soon as the block has been finalized, the VWAP price of these prices is calculated. This is done by accumulating the previously calculated volume-price-products of all trades and dividing them by the sum of all volumes combined.

The result is then returned as the result of the filter operation.

Filter Application

The VWAP filter is used in DIA's price determination. Our API can display the latest VWAP filter values, i.e., the filter results from a 120 second interval of all recorded trades for an asset.

Implementation

The filter is implemented as part of the FiltersBlockService in .

this file in our Github repository