360 Secure SkillHub
360 安全技能中心

crypto-gas-fee-optimizer

通过公共 RPC 查询 Ethereum、Base、Arbitrum、Optimism、Polygon 五条 EVM 链的实时 gas 价格,用 CoinGecko 免费价格换算估算指定 gas 用量的 USD 交易成本,并按成本从低到高排序,附带基于历史低流量时段的粗略时间提示;只做只读成本估算,不签名或广播交易。

ssidharhubble
ssidharhubble
热度 15.86
最近更新 2026-07-26 13:00:43
分类:数据依赖:代码执行 / 第三方 API应用场景:财务 / 报告撰写 / 推荐

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add crypto-gas-fee-optimizer
Metadata
name
crypto-gas-fee-optimizer
description
Check live gas prices across Ethereum, Base, Arbitrum, Optimism, and Polygon in one call using free public RPC endpoints (no API key required), rank chains by estimated USD transaction cost, and get a general low-traffic timing note. Built for crypto traders, DeFi users, and smart contract deployers who want to pick the cheapest chain or time before sending a transaction. Complements trading, defi, and smart contract skills by covering the operational cost side of on-chain activity — useful before bridging, swapping, claiming an airdrop, deploying a contract, or moving whale-sized positions where gas costs compound across many transactions.
compatibility
Created for Zo Computer
metadata
{"author":"ssyopros.zo.computer"}
allowed-tools
Bash

Crypto Gas Fee Optimizer

Queries live eth_gasPrice and eth_getBlockByNumber from free public RPC endpoints across five major EVM chains, converts to an estimated USD cost using live ETH/MATIC prices from CoinGecko, and ranks chains cheapest-first.

When to use

  • Deciding which chain to execute a transaction, swap, or bridge on right now
  • Estimating the USD cost of a batch of transactions (e.g. an airdrop claim, NFT mint, or contract deployment) before committing
  • Checking whether current gas is unusually high or low before a time-sensitive on-chain action
  • Comparing gas across Ethereum, Base, Arbitrum, Optimism, and Polygon in a single call

Commands

python3 scripts/gas_check.py                                  # All 5 chains, simple-transfer gas limit
python3 scripts/gas_check.py --chains ethereum,base            # Just the chains you care about
python3 scripts/gas_check.py --gas-limit 150000                # Price out a contract call, not just a transfer
python3 scripts/gas_check.py --json                            # Raw JSON output

Output

A table (or JSON) of chain, gas price in gwei, base fee, and estimated USD cost for the given gas limit, sorted cheapest-first. Includes a timing note based on typical low-traffic UTC hours (~02:00-09:00 UTC, the US-overnight/early-Asia window) — this is a general historical pattern, not a live congestion prediction, so treat it as a rough heuristic alongside the live gas numbers, not a substitute for them.

Notes

  • Data sources: publicnode.com free RPC endpoints (Ethereum, Base, Arbitrum, Optimism, Polygon) and CoinGecko's free simple-price endpoint for USD conversion. No API keys required.
  • Requests use a curl-style User-Agent header — some public RPC providers 403 the default Python User-Agent, so this is required for the script to work, not cosmetic.
  • Read-only: this tool does not sign or broadcast transactions, it only estimates cost. Actual gas cost depends on your specific transaction's gas usage, which can differ from the estimate.