CAR #004: Volume Weighted Average Price (VWAP) | Methodology

Community Approval Request #004: Volume Weighted Average Price
Date: Fri, 04 February 2022
Author: DIA Core Team
Status: Approved

In this fourth Community Approval Request (CAR), the DIA DAO community will discuss, improve and approve the volume Weighted Average Price methodology, a very commonly used filter by DIA for its oracle price determination.

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.

Head over to Snapshot to vote

Timeline:

  • Discussion: 4 Feb - 11 Feb
  • Vote: 11 Feb - 18 Feb
  • Approval: 18 Feb