
Optimizing Gas Fees
FreeReduce blockchain transaction costs with real-time analysis.
Free · Opens the source repo
What Optimizing Gas Fees does
The Optimizing Gas Fees skill provides developers and crypto enthusiasts with tools to effectively manage and minimize gas fees associated with blockchain transactions. By leveraging real-time data from multiple sources, this skill fetches current gas prices and allows users to estimate transaction costs in both ETH and USD. It also analyzes historical gas price patterns, helping users identify optimal times for transactions to save costs. This skill is particularly useful for those who frequently interact with Ethereum and other supported chains, enabling them to make informed decisions when executing transactions.
The skill's functionality extends beyond simple price fetching; it also predicts future gas prices based on historical data and current trends. Users can compare gas prices across various chains, including Ethereum, Polygon, Arbitrum, and Optimism, providing a comprehensive view of transaction costs in the blockchain ecosystem. With this capability, developers can optimize their transaction strategies, ensuring they transact when gas fees are at their lowest.
To get started, users need Python 3.8+ and network access to RPC endpoints. The skill includes various commands that allow users to check current gas prices, estimate costs for specific operations, and find the best times to transact. Additionally, it provides insights into hourly and daily gas patterns, which can be crucial for timing transactions effectively. The skill is designed for anyone involved in blockchain transactions, from casual users to professional developers, looking to optimize their costs and enhance their transaction efficiency.
When to use it
Use this skill when you need to check current gas prices, estimate transaction costs, or find the best times to execute blockchain transactions.
When not to use it
This skill may not be suitable for users who require a simple transaction execution without concern for gas fees or those who do not interact with multiple blockchain networks.
What you can build with it
Estimating Costs for a Swap
Use the skill to estimate the transaction cost for a Uniswap swap operation, helping you budget for your trades.
Finding Optimal Transaction Times
Analyze historical gas patterns to determine the best times to execute transactions, reducing your overall costs.
Comparing Gas Across Chains
Quickly compare gas prices across Ethereum, Polygon, and other supported chains to choose the most cost-effective option.
How to install Optimizing Gas Fees
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/optimizing-gas-fees --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeremylongshoreOptimizing 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_KEYfor higher rate limits - Optional: Custom RPC URLs via environment variables
Instructions
-
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 -
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 -
Find the optimal transaction window with lowest expected gas:
cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py optimal -
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 -
Predict future gas prices for a given hour:
cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py predict --time 14 -
Compare gas prices across multiple chains:
cd ${CLAUDE_SKILL_DIR}/scripts && python3 gas_optimizer.py compare -
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
| Chain | Native Token | Block Time |
|---|---|---|
| Ethereum | ETH | ~12 sec |
| Polygon | MATIC | ~2 sec |
| Arbitrum | ETH | ~0.25 sec |
| Optimism | ETH | ~2 sec |
| Base | ETH | ~2 sec |
Price Tiers
| Tier | Percentile | Confirmation Time |
|---|---|---|
| Slow | 10th | 10+ blocks (~2+ min) |
| Standard | 50th | 3-5 blocks (~1 min) |
| Fast | 75th | 1-2 blocks (~30 sec) |
| Instant | 90th | Next 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
- EIP-1559 - Fee market specification
- Etherscan Gas Tracker - Reference oracle
- L2Fees - L2 cost comparison
Frequently asked questions about Optimizing Gas Fees
Similar skills
WinMD API Search
Easily find and explore Windows desktop APIs.
WebMCPify
Transform any web app into an agent-ready platform.
Phoenix Tracing
Instrument LLM applications with OpenInference tracing.
Foundry Hosted Agent CopilotKit
Guidance for developing agentic web apps on Azure.
Power Automate Foundation
Connect AI agents to Power Automate seamlessly.
Power Automate Flow Builder
Efficiently build and deploy Power Automate flows programmatically.
