jeremylongshore

optimizing-gas-fees

@jeremylongshore/optimizing-gas-fees
jeremylongshore
1,004
123 forks
Updated 1/18/2026
View on GitHub

Optimize blockchain gas costs by analyzing prices, patterns, and timing. Use when checking gas prices, estimating costs, or finding optimal windows. Trigger with phrases like "gas prices", "optimize gas", "transaction cost", "when to transact".

Installation

$skills install @jeremylongshore/optimizing-gas-fees
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathplugins/crypto/gas-fee-optimizer/skills/optimizing-gas-fees/SKILL.md
Branchmain
Scoped Name@jeremylongshore/optimizing-gas-fees

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: optimizing-gas-fees description: | Optimize blockchain gas costs by analyzing prices, patterns, and timing. Use when checking gas prices, estimating costs, or finding optimal windows. Trigger with phrases like "gas prices", "optimize gas", "transaction cost", "when to transact". allowed-tools: Read, Bash(python3 *) version: 1.0.0 author: Jeremy Longshore jeremy@intentsolutions.io license: MIT

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

cd {baseDir}/scripts && python3 gas_optimizer.py current

For specific chain:

cd {baseDir}/scripts && python3 gas_optimizer.py current --chain polygon

2. Estimate Transaction Cost

For known operations:

cd {baseDir}/scripts && python3 gas_optimizer.py estimate --operation uniswap_v2_swap --all-tiers

For custom gas limit:

cd {baseDir}/scripts && python3 gas_optimizer.py estimate --gas-limit 150000 --tier fast

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

3. Find Optimal Transaction Window

cd {baseDir}/scripts && python3 gas_optimizer.py optimal

4. View Gas Patterns

Hourly patterns:

cd {baseDir}/scripts && python3 gas_optimizer.py patterns

Daily patterns:

cd {baseDir}/scripts && python3 gas_optimizer.py patterns --daily

5. Predict Future Gas

cd {baseDir}/scripts && python3 gas_optimizer.py predict --time 14

6. Compare Chains

cd {baseDir}/scripts && python3 gas_optimizer.py compare

7. View Base Fee History

cd {baseDir}/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 {baseDir}/references/errors.md for:

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

Examples

See {baseDir}/references/examples.md for:

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

Resources

More by jeremylongshore

View all
rabbitmq-queue-setup
1,004

Rabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.

model-evaluation-suite
1,004

evaluating-machine-learning-models: This skill allows Claude to evaluate machine learning models using a comprehensive suite of metrics. It should be used when the user requests model performance analysis, validation, or testing. Claude can use this skill to assess model accuracy, precision, recall, F1-score, and other relevant metrics. Trigger this skill when the user mentions "evaluate model", "model performance", "testing metrics", "validation results", or requests a comprehensive "model evaluation".

neural-network-builder
1,004

building-neural-networks: This skill allows Claude to construct and configure neural network architectures using the neural-network-builder plugin. It should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance with defining the layers, parameters, and training process. The skill is triggered by requests involving terms like "build a neural network," "define network architecture," "configure layers," or specific mentions of neural network types (e.g., "CNN," "RNN," "transformer").

oauth-callback-handler
1,004

Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.