Skip to main content

Overview

The Oracle contract is responsible for secure and configurable price reporting for supported assets. It is tightly coupled with a vault module (implementing IShareModule) and provides price validation, deviation tracking, and rate-limited report submission. It enforces strong assumptions around data integrity, report timing, and trust minimization through roles and deviation thresholds. This oracle ensures consistent pricing across all queue, share, and vault-related computations.

Key Responsibilities

  • Report Submission: Allows trusted accounts to submit price updates
  • Deviation Analysis: Compares new prices against the last report for suspicious behavior
  • Timestamp-based Rate Limiting: Prevents frequent or premature reports
  • Asset Management: Controls which tokens are supported by the oracle
  • Oracle Price Validation: Used by other modules (e.g., SignatureQueue) to verify incoming prices

Roles

SecurityParameters

  • Absolute Deviation: Hard limits on price delta in price units
  • Relative Deviation: Tolerance as a percentage (e.g., 5% = 0.05e18)
  • Timeout: Minimum time between valid reports (ignored if the previous report is suspicious)
  • depositInterval: Minimum age required for a deposit to be processed
  • redeemInterval: Same, but for redemptions

Reports

Used to validate asset prices and coordinate cross-queue processing.

Key Functions

View

Mutable

Reporting Logic

When calling submitReports(...):
  1. Each asset is checked for support
  2. The previous report is evaluated:
    • If timeout has not passed, and the report is not suspicious → revert TooEarly
  3. Price is compared against previous:
    • Too far off → revert InvalidPrice
    • Moderately off → flagged isSuspicious
  4. If the report is accepted:
    • Triggers vault.handleReport(...) with adjusted deposit and redeem timestamps
    • Emits ReportsSubmitted

Validation Logic

Prices are validated by:
  • Calculating absolute deviation
  • Calculating relative deviation
  • Comparing against max and suspicious thresholds
A price is:
  • Rejected if either deviation exceeds max
  • Accepted but suspicious if above suspicious threshold
  • Accepted as normal if within all limits
Used by:
  • SignatureDepositQueue, SignatureRedeemQueue, DepositQueue and RedeemQueue contracts
  • Vault’s limit accounting (RiskManager)

Events

Security Considerations

  • Only trusted roles can push prices
  • Suspicious reports cannot be accepted without explicit approval
  • No pricing logic oracles trust external feeds — price validation is local
  • Prevents manipulation by enforcing absolute & relative deviation constraints