Skip to content

thinkshake/gaswatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⛽ GasWatch

Ethereum Gas Price Monitor & Alert System

GasWatch helps you save money on Ethereum transactions by monitoring gas prices and alerting you when they drop to your target level. Never overpay for gas again!

GasWatch

✨ Features

  • 📊 Real-time Gas Prices — View current low/standard/fast/instant prices
  • 🔔 Smart Alerts — Get notified when gas drops below your threshold
  • 📱 Multi-channel Notifications — Console, desktop, Slack, Discord, webhooks
  • 🎨 Beautiful CLI — Color-coded output with visual indicators
  • ⚡ Multiple Providers — Etherscan, Beaconcha.in, Blocknative support
  • 🛡️ Cooldown System — Avoid alert spam with configurable cooldowns

🚀 Quick Start

Installation

# Clone and build
git clone https://github.com/thinkshake/gaswatch.git
cd gaswatch
go build -o gaswatch ./cmd/gaswatch

# Or install directly
go install github.com/thinkshake/gaswatch/cmd/gaswatch@latest

Basic Usage

# Check current gas prices
./gaswatch

# Compact single-line output
./gaswatch now --compact

# JSON output (for scripts)
./gaswatch now --json

Watch & Alert

# Alert when gas drops below 20 gwei
./gaswatch watch --below 20

# Alert when gas exceeds 100 gwei
./gaswatch watch --above 100

# Monitor "fast" tier instead of standard
./gaswatch watch --below 30 --speed fast

# Desktop notifications (macOS/Linux/Windows)
./gaswatch watch --below 20 --desktop

# Slack notifications
./gaswatch watch --below 20 --slack-webhook "https://hooks.slack.com/..."

# Discord notifications
./gaswatch watch --below 20 --discord-webhook "https://discord.com/api/webhooks/..."

# Multiple notification channels
./gaswatch watch --below 25 --desktop --slack-webhook URL --sound

# Custom check interval and cooldown
./gaswatch watch --below 20 --interval 60 --cooldown 10

📊 Output Examples

Full View

╔═══════════════════════════════════════════════════════╗
║       ⛽ GasWatch - Ethereum Gas Price Monitor         ║
╚═══════════════════════════════════════════════════════╝

┌─────────────────────────────────────────────────────┐
│ 🟢 Low - Great time to transact!                    │
├─────────────────────────────────────────────────────┤
│ 🐢 Low (Slow)    12.0 gwei  ██████░░░░░░░░░░░░░░  │
│ 🚶 Standard      15.0 gwei  ███████░░░░░░░░░░░░░  │
│ 🚗 Fast          18.0 gwei  █████████░░░░░░░░░░░  │
│ ⚡ Instant       22.0 gwei  ███████████░░░░░░░░░  │
├─────────────────────────────────────────────────────┤
│ Source: etherscan        Updated: 14:32:15         │
└─────────────────────────────────────────────────────┘

Compact View

🟢 ⛽ Low: 12 | Std: 15 | Fast: 18 | Inst: 22 gwei [14:32:15]

Alert

🔔 GAS ALERT: Gas is below! standard gas below 20.0 gwei
   Current prices - Low: 12.0 | Standard: 15.0 | Fast: 18.0 | Instant: 22.0 gwei

🔧 Configuration

Environment Variables

export ETHERSCAN_API_KEY="your-api-key"      # Optional, for higher rate limits
export SLACK_WEBHOOK_URL="https://hooks..."   # Default Slack webhook
export DISCORD_WEBHOOK_URL="https://disc..."  # Default Discord webhook

Speed Tiers

Tier Description Use Case
low Slow, ~10+ minutes Non-urgent transactions
standard Normal, ~3-5 minutes Regular transactions
fast Fast, ~1-2 minutes Time-sensitive txs
instant Immediate, <1 minute MEV, arbitrage

Gas Level Indicators

Indicator Gwei Range Meaning
🟢 <20 Low - Great time!
🟡 20-50 Medium - Normal
🔴 50-100 High - Consider waiting
🔥 >100 Extreme - Very congested

🔌 API Providers

GasWatch uses multiple providers for reliability:

  1. Etherscan — Most reliable, optional API key
  2. Beaconcha.in — Free, no key needed
  3. Blocknative — Professional grade (requires key)

The tool automatically falls back to the next provider if one fails.

💡 Tips

Save Money on Gas

  1. Watch for dips: Gas is often cheapest late night/early morning UTC
  2. Set low alerts: Get notified when gas drops to your ideal level
  3. Batch transactions: Combine multiple operations when gas is low
  4. Use Layer 2: Consider Arbitrum, Optimism, or Base for lower fees

Example Cron Setup

# Check gas every 5 minutes, alert if below 15 gwei
*/5 * * * * /path/to/gaswatch now --compact >> /var/log/gaswatch.log

Integrate with Scripts

# Get current standard gas price
GAS=$(./gaswatch now --json | jq -r '.standard')
if (( $(echo "$GAS < 20" | bc -l) )); then
    echo "Gas is low! Time to transact."
fi

🛠️ Development

# Run tests
go test ./...

# Build for multiple platforms
GOOS=darwin GOARCH=amd64 go build -o gaswatch-macos ./cmd/gaswatch
GOOS=linux GOARCH=amd64 go build -o gaswatch-linux ./cmd/gaswatch
GOOS=windows GOARCH=amd64 go build -o gaswatch.exe ./cmd/gaswatch

📜 License

MIT - Monitor gas freely!

💭 Philosophy

"Time in the market beats timing the market. But timing the gas? That's just smart."

Every gwei saved is a gwei earned. GasWatch helps you transact at the right time.


Built with 💙 by Aston — Save money, save gas! ⛽

Co-authored-by: Aston aston-ai@thinkshake.net

About

⛽ Ethereum Gas Price Monitor & Alert System - Get notified when gas is cheap!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages