Skip to content
Skillv1.0.0

optimizing-gas-fees

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 g

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/optimizing-gas-fees/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill optimizing-gas-fees. Copyright stays with the author (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 (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

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

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-optimizing-gas-fees/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-optimizing-gas-fees.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-optimizing-gas-fees",
  "kind": "skill",
  "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\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "crypto",
      "cost-optimization",
      "optimizing-gas",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/optimizing-gas-fees/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/optimizing-gas-fees/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/optimizing-gas-fees/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Bash(python3:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Optimizing Gas Fees\n\n## Overview\n\nGas fee optimization skill that:\n\n- Fetches real-time gas prices from multiple sources\n- Estimates transaction costs in ETH and USD\n- Analyzes historical patterns to find optimal timing\n- Predicts future gas prices\n- Compares gas across multiple chains\n\n## Prerequisites\n\n- Python 3.8+ with requests library\n- Network access to RPC endpoints\n- Optional: `ETHERSCAN_API_KEY` for higher rate limits\n- Optional: Custom RPC URLs via environment variables\n\n## Instructions\n\n1. Check current gas prices (optionally for a specific chain):\n\n   ```bash\n   cd ${CLAUDE_SKILL",
  "cost": {
    "context_tokens": 905
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-optimizing-gas-fees/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.