Gas Data Manager

Overview

The Gas Data Manager (GDM) is responsible for loading, processing, and providing historical and current gas price data, ensuring that our DEX strategies can accurately estimate transaction costs.

The Gas Data Manager (GDM) supports our V4 vision by replacing API-dependent gas cost calculations with offline data derived from Owlracle. Our Data Performance Documentation details how local data sources accelerate backtesting and enable more complex tests.

By centralizing gas data handling, the GDM promotes a clear separation of concerns, allowing strategy logic to remain focused on decision-making rather than cost calculations. This modular approach simplifies maintenance, supports independent refinement of components, and ensures data integrity as we expand our capabilities.

Architecture and Data Flow

Design Decisions and Rationale

Why Owlracle? We could immediately download a year’s worth of daily gas price data without subscriptions or complex scripts, allowing us to integrate realistic gas costs into backtesting quickly. The daily OHLC format helps us gauge price variability and decide later if higher granularity is needed.

Why JSON Files Initially? JSON was the fastest way to get started. It’s easy to parse and human-readable, letting us immediately integrate gas data into the backtesting pipeline. While not the most efficient long-term, this approach minimized setup overhead and got the system up and running.

Why This Data Structure? We kept the original Owlracle format (daily OHLC, timestamp, avgGas, samples) to avoid unnecessary data transformations. This lets us start testing realistic gas costs immediately. Once validated, we can later optimize formats (e.g., move to Parquet).

Minimal Rate Oracle Queries We only query RateOracle once per backtest and cache the result, ensuring this integration doesn’t slow down the simulation and maintains the performance benefits of our offline data approach.

Last updated