Skip to content

feat: multi-oracle price aggregation with median selection for manipulation resistance #280

Description

@abayomicornelius

Summary

The current oracle accepts prices from a single signer. A compromised or manipulated keeper can submit any price they want. Using multiple independent price sources with median selection significantly raises the attack cost.

Proposed Design

  • Allow up to N (configurable, default 3) trusted signer addresses per token
  • Each execution call includes a price submission from each registered signer
  • The oracle computes the median of submitted min prices and median of max prices
  • A minimum quorum (e.g., 2-of-3) must submit for the price to be valid

Keeper Protocol Change

Keepers must collect signed prices from all registered signers before calling any execution function.

Acceptance Criteria

  • Oracle accepts multiple signers per token
  • Median computation is correct for odd and even signer counts
  • Execution reverts if fewer than quorum signers submitted
  • Single-signer config works as before (no breaking change if N=1)
  • Integration test: 3 signers, one submits outlier price — median is used, not outlier
  • Unit test: median function with 3, 5, and 2 values

Affected Contracts

oracle, all handler contracts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions