Skip to content

wakamex/lazygas

Repository files navigation

LazyGas: Ethereum Gas Price Optimization

Overview

LazyGas is a data-driven tool for optimizing Ethereum gas price recommendations. It analyzes historical transaction data to provide cost-effective gas price suggestions based on desired inclusion times and confidence levels.

Key Features

  • Data-driven recommendations: Uses actual inclusion rates from mempool data
  • Confidence levels: Provides gas prices for different confidence levels (50%, 70%, 90%)
  • Inclusion time targeting: Optimizes for various inclusion time targets from 12 seconds to 24 hours
  • MEV transaction filtering: Removes 0 gas price transactions and special transactions with 0 inclusion delay

Gas Price Analysis

Gas Price Analysis

Gas Price Recommendations

Based on our analysis of Ethereum transactions, we recommend the following gas prices:

Inclusion Time 50% Confidence 70% Confidence 90% Confidence
12 seconds 1.00 Gwei 1.00 Gwei 10.00 Gwei
30 seconds 1.00 Gwei 1.00 Gwei 1.00 Gwei
1 minute 1.00 Gwei 1.00 Gwei 1.00 Gwei
5 minutes 1.00 Gwei 1.00 Gwei 1.00 Gwei
30 minutes 0.60 Gwei 0.60 Gwei 0.60 Gwei
1 hour 0.60 Gwei 0.60 Gwei 0.60 Gwei
6 hours 0.60 Gwei 0.60 Gwei 0.60 Gwei
24 hours 0.60 Gwei 0.60 Gwei 0.60 Gwei

Note: For lazy inclusion (> 5 minutes), lower gas prices (0.60 Gwei) are recommended across all confidence levels.

Key Findings

  1. Gas Price vs. Inclusion Time: Higher gas prices generally result in faster inclusion, but the relationship is not strictly linear.

  2. Inclusion Rate Analysis:

    • Transactions with gas prices between 0.5-1.0 Gwei have ~70% inclusion within 12 seconds and ~96% within 5 minutes
    • Transactions with gas prices between 1.0-2.0 Gwei have ~81% inclusion within 12 seconds and ~97% within 5 minutes
    • Transactions with gas prices above 10.0 Gwei have ~89% inclusion within 12 seconds and ~99% within 5 minutes
  3. Special Transactions: A significant number of transactions (~294K) had 0 inclusion delay, suggesting they were special transactions (MEV, flashbots, etc.) that were prioritized regardless of gas price.

Usage

Analyzing Gas Prices

.venv/bin/python plot_gas_prices.py

Getting Gas Price Recommendations

.venv/bin/python test_analysis.py

Data Sources

This analysis uses Ethereum transaction data from February 28, 2025, including:

  • Transaction metadata (gas prices, inclusion times, etc.)
  • Inclusion delay statistics

Dependencies

  • pandas
  • numpy
  • matplotlib

Implementation Details

The gas price recommendation algorithm:

  1. Filters out 0 gas price transactions and special transactions with 0 inclusion delay
  2. Analyzes inclusion rates for different gas prices and time windows
  3. Recommends the lowest gas price that achieves the desired inclusion time with the specified confidence level

Future Work

  • Incorporate time-of-day patterns into recommendations
  • Develop real-time recommendation API

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages