OP

optimizing-gas-fees

Checks real-time gas prices, estimates transaction costs, and identifies optimal timing for executing on-chain operations.

Install

mkdir -p .claude/skills/optimizing-gas-fees && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6614" && unzip -o skill.zip -d .claude/skills/optimizing-gas-fees && rm skill.zip

Installs to .claude/skills/optimizing-gas-fees

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Optimize blockchain gas costs by analyzing prices, patterns, and timing.
72 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Fetch real-time gas prices across multiple chains
  • Estimate transaction costs in ETH and USD
  • Analyze historical hourly and daily gas patterns
  • Predict future gas prices for specific hours
  • Compare gas fees across different blockchains

How it works

The skill utilizes Python scripts to query RPC endpoints for real-time gas metrics and historical block data. It processes this data to provide cost estimations and predictive analysis for various blockchain operations.

Inputs & outputs

You give it
Chain name, operation type, or gas limit
You get back
Gas cost estimates, optimal transaction windows, or price history

When to use optimizing-gas-fees

  • Estimate gas costs before initiating transactions
  • Find optimal windows for low-cost token swaps
  • Compare gas fees across different chains
  • Automate monitoring of gas price spikes

About this skill

Optimizing Gas Fees

Overview

Gas fee optimization skill that:

  • Fetches real-time gas prices from multiple sources
  • Estimates transaction costs in ETH and USD
  • Analyzes historical patterns to find optimal timing
  • Predicts future gas prices
  • Compares gas across multiple chains

Prerequisites

  • Python 3.8+ with requests library
  • Network access to RPC endpoints
  • Optional: ETHERSCAN_API_KEY for higher rate limits
  • Optional: Custom RPC URLs via environment variables

Instructions

  1. Check current gas prices (optionally for a specific chain):

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py current
    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py current --chain polygon
    
  2. Estimate transaction cost for known operations or custom gas limits (available operations: eth_transfer, erc20_transfer, erc20_approve, uniswap_v2_swap, uniswap_v3_swap, sushiswap_swap, curve_swap, nft_mint, nft_transfer, opensea_listing, aave_deposit, aave_withdraw, compound_supply, compound_borrow, bridge_deposit):

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py estimate --operation uniswap_v2_swap --all-tiers
    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py estimate --gas-limit 150000 --tier fast  # 150000 = configured value
    
  3. Find the optimal transaction window with lowest expected gas:

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py optimal
    
  4. View gas patterns (hourly or daily):

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py patterns
    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py patterns --daily
    
  5. Predict future gas prices for a given hour:

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py predict --time 14
    
  6. Compare gas prices across multiple chains:

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py compare
    
  7. View base fee history for recent blocks:

    cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py history --blocks 50
    

Output

  • Current: Base fee, priority fee, and tier prices (slow/standard/fast/instant)
  • Estimate: Gas cost in native token and USD for each tier
  • Patterns: Historical hourly/daily patterns with low-gas markers
  • Optimal: Recommended transaction window with expected savings
  • Predict: Gas forecast for specific time with confidence
  • Compare: Side-by-side gas prices across chains

Supported Chains

ChainNative TokenBlock Time
EthereumETH~12 sec
PolygonMATIC~2 sec
ArbitrumETH~0.25 sec
OptimismETH~2 sec
BaseETH~2 sec

Price Tiers

TierPercentileConfirmation Time
Slow10th10+ blocks (~2+ min)
Standard50th3-5 blocks (~1 min)
Fast75th1-2 blocks (~30 sec)
Instant90thNext block (~12 sec)

Error Handling

See ${CLAUDE_SKILL_DIR}/references/errors.md for:

  • RPC connection issues
  • API rate limiting
  • Price feed errors
  • Pattern analysis errors

Examples

See ${CLAUDE_SKILL_DIR}/references/examples.md for:

  • Quick start commands
  • Cost estimation scenarios
  • Multi-chain comparison
  • Practical workflows

Resources

Prerequisites

Python 3.8+ with requests libraryNetwork access to RPC endpointsETHERSCAN_API_KEY (optional)Custom RPC URLs (optional)

Limitations

  • Requires network access to RPC endpoints
  • Dependent on RPC connection stability and API rate limits

How it compares

Unlike manual checking of block explorers, this skill automates multi-chain comparisons and provides predictive modeling for optimal transaction timing.

Compared to similar skills

optimizing-gas-fees side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
optimizing-gas-fees (this skill)127dReviewIntermediate
pdf-processing-pro1710moReviewIntermediate
python-repl64moReviewBeginner
math-router67moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry