gas-price-predictor
БесплатноЗапускает вложенные скриптыНе проверенPredict optimal gas prices for Base L2 transactions using historical block analysis and moving-average trends. Use when an agent needs to minimize gas costs…
от manteclaw210 установок в других каталогахОб этом скилле
Gas Price Predictor
Overview
Analyzes Base L2 gas markets to predict optimal transaction timing and gas price settings. Saves 10-40% on gas costs by avoiding peak congestion periods.
Core Capabilities
1. Historical Pattern Analysis
- Pulls last 200 blocks gas data from Base RPC (history fetches are capped at 200 blocks)
- Calculates moving averages (20-block, 50-block, 200-block when enough history was fetched)
- Detects congestion spikes vs normal periods
2. Real-Time Gas Forecast
- Current base fee + priority fee recommendation
- "Wait" vs "Execute Now" signal
- Confidence score (0-100%) based on pattern strength
- Estimated savings if waiting for optimal window
3. Optimal Timing Predictions
| Time (UTC) | Typical Gas | Recommendation |
|---|---|---|
| 02:00-06:00 | Low | Best window for non-urgent |
| 08:00-12:00 | Medium | Standard operations |
| 14:00-18:00 | High | Avoid if possible |
| 20:00-00:00 | Medium-High | Acceptable for urgent |
4. Agent Integration
- Returns structured JSON for automated decision-making
- Suggests
maxFeePerGasandmaxPriorityFeePerGasvalues - Polling monitor mode for continuous monitoring (prints alerts to stdout)
- Alert when gas drops below threshold
Workflow
Quick Check
python3 scripts/gas_predictor.py --quick
Output (--quick --json):
{
"current_base_fee_gwei": 0.05,
"recommended_priority_gwei": 0.001,
"total_gas_price_gwei": 0.051,
"congestion": "low",
"wait_recommended": false,
"estimated_cost_usd": 0.42,
"confidence": 87,
"avg_base_fee_gwei": 0.05,
"ratio_to_avg": 1.0,
"block_number": 12345678,
"timestamp": "2026-11-18T00:00:00+00:00"
}
Full Analysis
python3 scripts/gas_predictor.py --analyze --blocks 200
Continuous Monitor
python3 scripts/gas_predictor.py --monitor --threshold 0.1
RPC Endpoint
The script defaults to the public no-key Base endpoint (https://mainnet.base.org).
To use a keyed provider instead, set the full endpoint URL in the
BASE_RPC_URL environment variable or pass --rpc-url:
BASE_RPC_URL="https://base-mainnet.g.alchemy.com/v2/<your-key>" python3 scripts/gas_predictor.py --quick
No API key is hardcoded or shipped with this skill. Only https://
endpoints are accepted.
Scripts
scripts/gas_predictor.py— Main predictor with all modes
References
references/base-gas-model.md— EIP-1559 fee market on Base
Earnings Model
- Skill sale: $8-15 (saves users gas costs immediately)
- x402 per-call: $0.02 per prediction
- Subscribed monitoring: $5/mo for continuous alerts
Safety
- Never overestimates — conservative estimates default
- Falls back to current block base fee if prediction fails
- No transaction execution — pure advisory
- Read-only: makes JSON-RPC read calls only, never signs or sends transactions
- No credentials are stored in the skill; the RPC endpoint is configured via the
BASE_RPC_URLenvironment variable (or--rpc-url) and must behttps://
Tool Scope
- Network: outbound HTTPS requests to a single Base JSON-RPC endpoint only
(default
https://mainnet.base.org, overridable viaBASE_RPC_URL/--rpc-url). - The only request made is
eth_getBlockByNumberwith a block number parameter. The request carries no secrets, tokens, wallet addresses, or personal data — only the fixed JSON-RPC method name and the requested block number. - No file writes, no shell commands, no subprocesses, no deserialization of untrusted data, no transaction signing or submission.
Changelog
v1.0.3 — 2026-11-19 (vetting follow-up)
- Fixed an error-text credential leak (independent vetting F1):
_rpc_callprinted the rawrequestsexception, which includes the full request URL — and a keyed provider URL carries the key in its path. RPC failures now print a fixed message only (RPC error: request failed); the validator no longer echoes the URL in its error andmain()prints a fixed message for an invalid endpoint. Same defect class as the MEV SDI-4 fixed in v1.0.2.
v1.0.2 — 2026-11-19 (rescan follow-up)
- Declared the tool scope in machine-readable form (
permissions: [env, network]in the frontmatter) so the ClawHub scanner no longer flags the skill for undeclared scope (LP3). No code change; behavior is identical to v1.0.1.
v1.0.1 — 2026-11-18 (security patch)
- Removed the Alchemy API-key path: the
--alchemy-keyflag (which defaulted to a literal${ALCHEMY_API_KEY}placeholder and silently fell back to the key"demo") is gone. The RPC endpoint is now configured via theBASE_RPC_URLenvironment variable or--rpc-url, defaulting to the public no-key endpointhttps://mainnet.base.org. - Implemented the missing
analyze_patterns()method (previously called bypredict_optimal()and the--analyzepath but never defined, so every run crashed withNameError). It now computes average/
Установить gas-price-predictor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл gas-price-predictor?
Predict optimal gas prices for Base L2 transactions using historical block analysis and moving-average trends. Use when an agent needs to minimize gas costs, time transactions efficiently, or automate gas price selection for DeFi operations on Base L2.
Как установить скилл gas-price-predictor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gas-price-predictor запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic