jeremylongshore/tons-of-skills-marketplace / plugins/crypto/gas-fee-optimizer/skills/optimizing-gas-fees
optimizing-gas-fees
VerifiedOptimize 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".
| File | Kind | Size |
|---|---|---|
| ARD.md | markdown | 6.2 KB |
| PRD.md | markdown | 2.8 KB |
| SKILL.md | skill md | 4.1 KB |
| config/settings.yaml | config | 3.2 KB |
| references/errors.md | markdown | 3.0 KB |
| references/examples.md | markdown | 7.2 KB |
| references/implementation.md | markdown | 1.5 KB |
| scripts/cost_estimator.py | script | 7.4 KB |
| scripts/formatters.py | script | 7.0 KB |
| scripts/gas_fetcher.py | script | 11.0 KB |
| scripts/gas_optimizer.py | script | 11.1 KB |
| scripts/pattern_analyzer.py | script | 11.3 KB |
references/errors.md
View on GitHub# Error Handling Reference
## RPC Errors
**eth_feeHistory Not Supported**
- Error: `RPC error: Method not found`
- Cause: Chain doesn't support EIP-1559 fee history
- Solution: Falls back to `eth_gasPrice` automatically
**RPC Connection Timeout**
- Error: `Connection timed out` or `ETIMEDOUT`
- Cause: RPC node unresponsive or network issues
- Solution: Falls back to explorer API; check network; try alternate RPC
**Rate Limited by RPC**
- Error: `429 Too Many Requests`
- Cause: Exceeded RPC rate limits
- Solution: Uses cached data; wait before retry; use private RPC
## Explorer API Errors
**Etherscan API Key Missing**
- Error: `Max rate limit reached` for free tier
- Cause: No API key, limited to 1 req/5s
- Solution: Set `ETHERSCAN_API_KEY` environment variable
**Invalid API Response**
- Error: `status: 0` in response
- Cause: API error or invalid request
- Solution: Check API key; verify chain support; use RPC fallback
## Price Feed Errors
**CoinGecko Rate Limit**
- Error: `429` response from price API
- Cause: Exceeded free tier (10-50 req/min)
- Solution: Uses cached price; default to $3000 ETH / $1 MATIC
**Price Not Available**
- Error: Token not found in price feed
- Cause: New/obscure token not tracked
- Solution: Uses default price estimate
## Pattern Analysis Errors
**No Historical Data**
- Error: Empty patterns or "Using defaults"
- Cause: New installation, no recorded history
- Solution: Uses default patterns; collects data over time
**Corrupted History File**
- Error: `JSONDecodeError` on history load
- Cause: File corruption or incomplete write
- Solution: Resets to empty history; starts fresh
## Chain-Specific Errors
**Unsupported Chain**
- Error: `Chain 'xyz' not supported`
- Cause: Chain not in configuration
- Solution: Use supported chains: ethereum, polygon, arbitrum, optimism, base
**L2 Gas Estimation**
- Error: Unexpected gas values on L2
- Cause: L2s have different fee structures
- Solution: L2 gas is typically much lower; estimates still accurate
## Fallback Chain
The system uses a fallback chain for resilience:
```
1. eth_feeHistory (EIP-1559) → Best data
↓ fails
2. eth_gasPrice (legacy) → Estimates tiers
↓ fails
3. Explorer API (Etherscan) → External oracle
↓ fails
4. Default values → 30 gwei baseline
```
## Environment Variables
| Variable | Purpose | Default |
|----------|---------|---------|
| `ETHERSCAN_API_KEY` | Explorer API auth | None (rate limited) |
| `ETHEREUM_RPC_URL` | Custom Ethereum RPC | Public endpoints |
| `POLYGON_RPC_URL` | Custom Polygon RPC | Public endpoints |
| `ARBITRUM_RPC_URL` | Custom Arbitrum RPC | Public endpoints |
## Common Fixes
1. **Slow response**: Enable caching, check network
2. **Inaccurate estimates**: Verify chain selection, check RPC sync
3. **Missing patterns**: Wait for data collection, use defaults
4. **High variance**: Normal during network congestion
---
*[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |