🥚
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

Gas Profiling

Understanding the Oval Gas overhead.

PreviousOvalNextTechnical Examples

Last updated 10 months ago

Was this helpful?

Oval serves as a wrapper for oracles, and as such adds a small gas overhead to accessing the price price. This docs page breaks down the extra gas added for AAVE v3.

Oval adds ~8k Gas per data read.

Typically, contracts retrieve data from Chainlink using , or the now-deprecated , which remains in use in numerous contracts. Oval acts as an intermediary to the Chainlink interfaces, exposing the same read functions. The integration adds a minimal overhead of approximately 8,000 gas per read. Such an increase is relatively minor, typically less than 4% of the total cost associated with operations such as borrowing money or liquidating positions in protocols that utilize these data feeds.

Moreover, repeated reads from the same feed are more cost-effective due to state warming. For example, in an AAVE v3 borrow operation, which requires two price feed reads, the total additional cost is just ~12k Gas. This efficiency results from the EVM's optimized handling of repeated reads from the same memory slot.

Operation

Without Oval Consumption

With Oval Consumption

Gas Difference

Percentage

AAVE V3 borrow()

+ 12,062 Gas

+ 3.59%

AAVE V3 liquidationCall()

+ 12,190 Gas

+ 3.13%

AAVE V2 borrow()

+ 9,774 Gas

+ 1.88%

AAVE V2 liquidationCall()

+ 7,137 Gas

+ 1.63%

Oval results in a modest increase in gas consumption across different operations. It's important for protocols to weigh this increase against the specific functionalities and benefits they expect to derive from Oval integration.

We have performed for various protocols that use Chainlink data feeds, assessing their performance upon upgrading to Oval. For instance, the additional cost of implementing Oval with Chainlink in AAVE V3 is just +3.59% for borrowing against isolated assets and +3.13% for liquidations. The results of these simulations can be explored through the Tenderly simulations linked in the raw gas figures in the table below.

gas profiling
336,318 Gas
348,380 Gas
389,469 Gas
401,659 Gas
520,799 Gas
530,573 Gas
437,627 Gas
444,764 Gas
AggregatorV3Interface.latestRoundData()
latestAnswer()