LogoLogo
GitHub
  • Quickstart
    • What is eOracle?
    • eOracle Vision
    • Use eOracle
  • Build on eOracle
    • Introduction to eOracle Stack
    • What is an OVS
    • eOracle Features
    • eOracle Data Processing Flow
    • Builders Workflow
      • Set-up
      • Off-chain Computation
      • On-chain Components
      • Target Chains Publishing
    • Smart Contracts Overview
      • eOracle Chain contracts
      • Target Contracts
    • Aggregation Library
      • Median
      • Clustering
      • TWAP
      • Robust Aggregation 101
    • eOracle Cryptographic Broadcaster
    • Incentives Management
      • πŸ₯’On-chain-Subjective Slashing Framework
    • Active Specialized Blockchain Oracles
      • EtherOracle - Peg Securing Oracle by Etherfi
      • Pulse - Risk Oracle By Bitpulse
      • ECHO - Social Media Oracle
      • Borsa - Intent Optimisation
  • ePRICE
    • Introduction to ePRICE
    • Integration Guide
    • Risk Management and Market Integrity
    • 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
      • 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
    • API Reference
      • 🧩Examples
      • 🧩Off-chain Examples
    • Advanced
      • πŸ€–Automating eOracle 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 Oracle Design
  • Understand eOracle
    • eOracle 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
    • eOracle Chain
Powered by GitBook
On this page
  • Definition
  • Rationale and Properties
  • Limitations
Export as PDF
  1. Build on eOracle
  2. Aggregation Library

Median

PreviousAggregation LibraryNextClustering

Last updated 4 months ago

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).

Page cover image