Volume-weighted Average Price (VWAP) Oracle
1 min read
Pronunciation
[vah-loom weyt-ed av-er-ij prahys awr-uh-kl]
Analogy
Like calculating your average grocery bill by giving more weight to bulk purchases than occasional small items.
Definition
An oracle that computes the average price of an asset over a period weighted by traded volume, reducing bias from low-volume spikes.
Key Points Intro
VWAP oracles smooth price feeds by emphasizing high-volume trades.
Key Points
Volume weighting: multiplies prices by trade sizes
Time window: defines start and end for averaging
Data aggregation: collects trades from DEXs and CEXs
On-chain posting: publishes VWAP for smart contract consumption
Example
Technical Deep Dive
Aggregator nodes subscribe to trade events via subgraphs and exchange APIs, compute sum(price × volume) and sum(volume) per window, then publish ratio to an oracle contract. Contracts store cumulative values and update via keeper bots to maintain freshness.
Security Warning
Thin-volume markets can still be manipulated by large single trades; ensure diversified data sources.
Caveat
High-frequency updates increase gas costs; balance between granularity and cost.
Volume-weighted Average Price (VWAP) Oracle - Related Articles
No related articles for this term.