🥚
Oval
  • Oval Overview
    • Problem
    • System Overview
  • Integration
    • Quickstart Deployment
    • Morpho Deployment
    • Advanced Deployment
  • Mechanism Details
    • Integration with MEV-Share
    • Mechanism Description
    • Trust Assumptions
    • Oval Update Lifecycle
    • Inclusion Rates
    • Revenue Sharing
  • Contract Architecture
    • Source Adapters
    • Destination Adapters
    • Integration Controllers
    • Oval
    • Gas Profiling
  • Technical Examples
    • Aave Integration
    • Flashbots Integration
  • For Searchers
    • Getting Started
    • Header Specifications
    • Oval Node
  • OEV Data
  • Oval Demo
  • Audit and Bug Bounty
  • Oval Deployments
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Contract Architecture

Source Adapters

Standardization contract to unify incoming interfaces.

PreviousContract ArchitectureNextDestination Adapters

Last updated 10 months ago

Was this helpful?

This adapter wraps an oracle interface for ingestion into the Oval contract, allowing the Oval to handle any custom middleware or interaction patterns that a protocol uses for talking to Chainlink contracts. The common example is the standard that interacts with a standard Chainlink interface in the case that there is no middleware between the protocol and a standard Chainlink feed.

  1. Access Chainlink prices via any interface.

  2. Standardize decimals across different feeds. All internal logic assumes 18 decimals.

In internal Oval calls (between source adapter, Oval contract, and destination adapters) we pass around “sourceData” which is a tuple of the latest price and latest timestamp as (int256, uint256).

The minimal interface for a source adapter looks as follows:

interface IXSourceOracleAdapter { // Returns the latest price data from the source and the update timestamp. function getLatestSourceData() view returns (int256, uint256);

// Tries getting latest data as of requested timestamp. 
// If this is not available returns the earliest data available past the
// requested timestamp bounded by maxTraversal.
function tryLatestDataAt(uint256 timestamp, uint256 maxTraversal) view returns (int256, uint256);

// If the source requires snapshotting, this executes the snapshot.
function snapshotData() external;
}

Oval offers multiple source adapters. The directory containing the source adapters can be found

The following table summarizes the Source Adapters supported by Oval and their compatibilities with Source Oracles. A single adapter can be compatible with multiple Oracles (e.g., ChainlinkSourceAdapter can be used for both Chainlink and Redstone Classic, as they implement the same interfaces). In the resources column, you will find tools and documentation to deploy your Oval instance with your required configuration.

Source Oracle
Source Adapter
Audit
Resources

Chainlink Source Adapter
here.
Chainlink
ChainlinkSourceAdapter.sol
Audit report
Oval QuickStart
Redstone Classic
ChainlinkSourceAdapter.sol
Audit report
Oval QuickStart
Redstone Classic Docs