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

Median

Definition

The median algorithm returns the middle value from a sorted list of validator reports. It is most naturally used for numerical data but can be applied to any ordered set of data.

A possible variant is the weighted median - Let wiw^iwi be the stake of data validator iii, and assume that ∑i=1Nwi=1\sum_{i=1}^Nw^i=1∑i=1N​wi=1. Also, for simplicity, assume that rt1,rt2,...,rtNr_t^1,r_t^2,...,r_t^Nrt1​,rt2​,...,rtN​ are sorted. The weighted median is an element rtkr_t^krtk​ such that

∑i=1k−1wi≤12 and ∑i=k+1Nwi≤12\sum_{i=1}^{k-1} w^i \leq \frac{1}{2} \text{ and } \sum_{i=k+1}^{N} w^i \leq \frac{1}{2}i=1∑k−1​wi≤21​ and i=k+1∑N​wi≤21​

Rationale and Properties

  • Resistant to extreme values and outliers, as they only affect the tails of the sorted list—ignores the impact of anomalous data points due to its reliance on central values.

  • The aggregation value will always be between the honest reports, assuming a majority of the stake belongs to honest validators (weighted median)

Limitations

  • May not reflect the influence of large/small prices if they are outliers

  • Non-incremental - the aggregated value cannot be updated upon each report in an online manner (as opposed to mean, for example, which supports mn=n−1n⋅mn−1+rnnm_n=\frac{n-1}{n}\cdot m_{n-1}+\frac{r_n}{n}mn​=nn−1​⋅mn−1​+nrn​​ where mim_imi​

    is the mean after iii reports and rir_iri​ is the iii-th report).

PreviousAggregation LibraryNextClustering

Last updated 5 months ago