360 Secure SkillHub
360 安全技能中心

Gas Tracker

依次尝试公开 RPC 与区块浏览器 API,获取以太坊 Slow/Standard/Fast/Instant 四档 gas 价格(Gwei)、预计确认时间与基础费,输出终端表格或原始 JSON;并可用阈值告警,通过退出码表示标准档 gas 是否低于设定值,便于脚本或定时任务判断。

fuzzyb33s
fuzzyb33s
热度 53.59
最近更新 2026-06-23 13:15:36
分类:数据依赖:代码执行 / 第三方 API应用场景:报告撰写

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add fuzzyb33s/gas-tracker
Metadata
name
gas-tracker
description
Monitor current Ethereum gas prices (Slow/Standard/Fast/Instant tiers) with Gwei values and estimated confirmation times. Use when user asks about ETH gas prices, wants to check if network is congested, or set gas alerts for transactions. Fetches from public RPC and explorer APIs with automatic fallbacks.

Gas Tracker

Monitor Ethereum gas prices in Gwei across Slow / Standard / Fast / Instant tiers.

Quick Use

python scripts/gas_tracker.py
python scripts/gas_tracker.py --fast
python scripts/gas_tracker.py --alert 30
python scripts/gas_tracker.py --json

Output

  ETH Gas Tracker  |  Source: publicnode.com  |  Block #21345678
  Updated: 2026-06-23T07:10:00Z

  Tier      Gwei      ETA
  ------    ------    -------
  Slow      12.0 Gwei    ~15 min
  Standard  15.0 Gwei    ~5 min
  Fast      20.0 Gwei    ~2 min
  Instant   25.0 Gwei    ~30 sec

  Base Fee: 10.0 Gwei
  Status: LOW — Good time to transact

Flags

Flag Description
--slow Show slow tier only
--standard Show standard tier only
--fast Show fast tier only
--instant Show instant tier only
--alert GWEI Exit 0 if standard gas < GWEI, exit 1 if above
--json Raw JSON output

Data Sources

Tries in order: ethereum.publicnode.com RPC → api.blockscout.com → ethgas.info → api.ethgas.watch. Uses the first available.

Alert Script Example

Useful for cron jobs:

python scripts/gas_tracker.py --alert 30 && echo "Gas is low, good to swap!" || echo "Gas too high"