LogoLogo
GitHub
  • Quickstart
    • What is EO?
    • EO Vision
    • Use EO
  • Build on EO
    • Introduction to EO Stack
    • What is an OVS
    • EO Features
    • EO Data Processing Flow
    • Builders Workflow
      • Set-up
      • Off-chain Computation
      • On-chain Components
      • Target Chains Publishing
    • Smart Contracts Overview
      • EO Chain contracts
      • Target Contracts
    • Aggregation Library
      • Median
      • Clustering
      • TWAP
      • Robust Aggregation 101
    • EO Cryptographic Broadcaster
    • Incentives Management
      • 🄢On-chain-Subjective Slashing Framework
    • Active Specialized Blockchain Oracles
      • EtherOracle - Peg Securing Blockchain Oracle by Etherfi
      • Pulse - Risk Blockchain Oracle By Bitpulse
      • ECHO - Social Media Blockchain Oracle
      • Borsa - Intent Optimisation
  • ePRICE
    • Introduction to ePRICE
    • Integration Guide
    • Risk Management and Market Integrity
    • Feeds Addresses
      • Price Feed Addresses
        • Arbitrum
        • Arbitrum Sepolia
        • Base
        • Base Sepolia Testnet
        • Berachain
        • Blast
        • BNB Smart Chain
        • BOB
        • B Squared
        • B Squared Testnet
        • Hemi
        • Ink Sepolia
        • Ink Mainnet
        • Linea
        • Linea Sepolia
        • Ethereum
        • Manta
        • Manta Sepolia Tesnet
        • Mode
        • Mode Testnet
        • Monad Testnet
        • Morph
        • Morph Holesky
        • Polygon zkEVM
        • Polygon zkEVM Cardona Testnet
        • Plume
        • Plume Testnet
        • Scroll
        • Soneium
        • Sonic
        • Soneium Testnet
        • TAC Turin Testnet
        • Taiko Mainnet
        • Unichain
        • Unichain Sepolia
        • Zircuit
        • Zircuit Testnet
        • zkLink Nova Mainnet
      • PT Feeds Addresses
        • Pendle
          • Ethereum
          • Sonic
      • Custom Asset Feeds
    • API Reference
      • 🧩Examples
      • 🧩Off-chain Examples
    • Advanced
      • šŸ¤–Automating EO consumption
      • šŸ’±Getting a different currency pair
  • EO Token
    • The EO Token
    • Ecosystem Participants
    • EO Token Utility
    • EO Token Flywheel
    • Security and Enforcement
    • A New Chapter in Blockchain Oracle Design
  • Understand EO
    • EO Trust Model
    • Architecture Overview
    • Data Processing
    • Security
      • Cryptoeconomic Security
      • Aegis - Validator Set Configuration
  • Operators
    • Installation
    • Registration
    • Running the Client
    • Monitoring
  • šŸ”Concepts
    • EigenLayer
    • Data Validators
    • Chain Validators
    • eBFT
    • OVS
    • EO Chain
Powered by GitBook
On this page
  • Definition
  • Rationale and Properties
  • Limitations
Export as PDF
  1. Build on EO
  2. Aggregation Library

TWAP

PreviousClusteringNextRobust Aggregation 101

Last updated 5 months ago

Prices are susceptible to noise and volatility. Therefore, financial applications often average prices over time. Well-known methods include Moving Average, Exponential Smoothing, Time-weighted Average Price (TWAP), and Volume-weighted Average Price (VWAP)

Definition

TWAP (Time-Weighted Average Price) - calculates an average value over a specified time period, weighting each data point by the duration or frequency of updates.

TWAP is calculated as follows:

PTWAP=āˆ‘jPjā‹…Tjāˆ‘jTjP_{\text{TWAP}} = \frac{\sum_{j} P_j \cdot T_j}{\sum_{j} T_j}PTWAP​=āˆ‘j​Tjā€‹āˆ‘j​Pj​⋅Tj​​

where PjP_jPj​ is the value of the at the jjj-th measurement and TjT_jTj​ is the change in time since the previous measurement.

Rationale and Properties

  • Reduces the impact of rapid fluctuations in the data by spreading them out over time.

  • Incorporates time factors, making the final output reflective of trends rather than single-point events.

  • Offers smoother price data for algorithmic trading and liquidity management.

Limitations

  • Less appropriate sensitive to fast market shifts or abrupt changes -smoothing over time makes TWAP less responsive than other algorithms.

  • Requires additional storage of the historic data.