crypto-price-monitor avatar

crypto-price-monitor

Real-time cryptocurrency price monitoring with intelligent alerts via CoinGecko API

cryptocurrencyprice-monitoringalertstradingcoingeckobitcoinethereumproactiveheartbeat
by openhatchβ€’about 2 months ago

Quick Start

# Install and run
openhatch run @openhatch/crypto-price-monitor

Template Contents

Browse files before installing this template.

Loading template files…

About

Crypto Price Monitor

Real-time cryptocurrency price tracking with intelligent alerts

A proactive OpenClaw agent that monitors cryptocurrency prices using CoinGecko's API and sends smart alerts when significant price movements occur. Perfect for traders, investors, and crypto enthusiasts who want to stay informed without constantly checking prices.

🎯 What It Does

  • Continuous monitoring β€” Checks prices every 5 minutes via scheduled heartbeat
  • Smart alerts β€” Only notifies on significant moves (configurable thresholds)
  • Multi-coin tracking β€” Monitor Bitcoin, Ethereum, and custom watchlists
  • Historical context β€” Shows 24h change, volume, and market cap
  • Rate-limit aware β€” Respects CoinGecko's free tier limits (50 req/min)
  • Beautiful formatting β€” Clean, emoji-rich price alerts

✨ Key Features

Proactive Heartbeat Monitoring

The agent wakes up every 5 minutes, checks your watchlist, and alerts you only when:

  • Price moves >5% in 5 minutes (significant movement)
  • Price crosses custom thresholds you've set
  • Major market events detected (>20% moves)

When nothing noteworthy happens, it stays silent with HEARTBEAT_OK.

Intelligent Alert Levels

  • 🚨 URGENT β€” >20% price change (major event)
  • ⚠️ IMPORTANT β€” 10-20% price change
  • πŸ’‘ INTERESTING β€” 5-10% price change
  • βœ… HEARTBEAT_OK β€” No significant movement

On-Demand Price Checks

Ask the agent anytime:

  • "What's the price of Bitcoin?"
  • "Show me ETH stats"
  • "Check my watchlist"
  • "Add Solana to my watchlist"

πŸ“‹ Prerequisites

  • OpenClaw v0.20.0 or later
  • CoinGecko API (free tier works great β€” no key required for basic usage)
  • Telegram/Discord/Signal account for receiving alerts

πŸš€ Quick Start

1. Install the template

hatchery run @openclaw/crypto-price-monitor

2. Configure your watchlist

Edit the initial watchlist in memory/watchlist.json or just tell the agent:

Add Solana and Cardano to my watchlist

3. Set alert thresholds (optional)

Alert me when Bitcoin moves more than 3% in 5 minutes

The agent will remember your preferences in MEMORY.md.

4. Sit back and receive alerts

The agent monitors continuously and alerts you only when something significant happens.

πŸ”§ Configuration

Environment Variables

No API keys required for basic usage! CoinGecko's free tier is accessed without authentication.

Optional:

# For higher rate limits (300 req/min)
COINGECKO_API_KEY=your_pro_api_key_here

# Set your timezone for time-aware alerts
USER_TIMEZONE=America/New_York

Watchlist Management

Your watchlist is stored in memory/watchlist.json:

{
  "coins": [
    {
      "id": "bitcoin",
      "symbol": "BTC",
      "alertThreshold": 5.0
    },
    {
      "id": "ethereum",
      "symbol": "ETH",
      "alertThreshold": 5.0
    }
  ]
}

You can edit this file directly or just talk to the agent naturally.

Heartbeat Schedule

By default, checks every 5 minutes. To adjust, modify the OpenClaw heartbeat configuration:

{
  "heartbeat": {
    "enabled": true,
    "interval": "*/5 * * * *"  // cron format: every 5 minutes
  }
}

πŸ’¬ Example Conversations

Adding Coins to Your Watchlist

You: Add Solana and Polkadot to my watchlist

Agent: βœ… Added to your watchlist:
β€’ Solana (SOL) β€” $98.45
β€’ Polkadot (DOT) β€” $7.23

I'll monitor these for significant price movements.

On-Demand Price Check

You: What's Bitcoin doing?

Agent: β‚Ώ Bitcoin (BTC)
πŸ’° $52,340.50
πŸ“Š 24h: +2.34% | Vol: $28.4B
πŸ“ˆ Market Cap: #1 ($1.03T)

Proactive Alert (Heartbeat)

Agent: 🚨 SIGNIFICANT PRICE MOVEMENT

β‚Ώ Bitcoin (BTC)
πŸ’° $54,123.00 (+3.4% in 5 min)
πŸ“Š 24h: +5.67%

This crossed your 3% alert threshold.

πŸ—οΈ Architecture

File Structure

workspace/
β”œβ”€β”€ README.md                 # This file
β”œβ”€β”€ hatchery.yaml            # Runtime config (Claude Sonnet, heartbeat enabled)
β”œβ”€β”€ SOUL.md                  # Agent personality (analytical, calm)
β”œβ”€β”€ AGENTS.md                # Behavioral instructions
β”œβ”€β”€ MEMORY.md                # Long-term preferences and knowledge
β”œβ”€β”€ IDENTITY.md              # Quick identity card
β”œβ”€β”€ TOOLS.md                 # Setup and customization guide
β”œβ”€β”€ HEARTBEAT.md             # Periodic monitoring checklist
β”œβ”€β”€ skills/
β”‚   └── coingecko/
β”‚       β”œβ”€β”€ SKILL.md         # CoinGecko API instructions
β”‚       └── fetch-price.sh   # Price fetching script
└── memory/
    β”œβ”€β”€ watchlist.json       # Your tracked coins
    └── heartbeat-state.json # Last check timestamps and values

How It Works

  1. Heartbeat trigger β€” OpenClaw calls the agent every 5 minutes
  2. Load state β€” Agent reads heartbeat-state.json for last known prices
  3. Fetch prices β€” Calls CoinGecko API via skills/coingecko/fetch-price.sh
  4. Compare & decide β€” Calculates % change, checks thresholds
  5. Alert or silence β€” Sends alert if significant, otherwise HEARTBEAT_OK
  6. Update state β€” Writes new prices to heartbeat-state.json

πŸ›‘οΈ Security & Privacy

  • Main session only β€” This agent is designed for personal use (operator only)
  • No DM/group sessions β€” Prevents unauthorized users from modifying your watchlist
  • API key protection β€” Never logs credentials to memory or transcripts
  • Read-only by default β€” Uses CoinGecko's public API (no trading capabilities)

πŸ“Š Rate Limits & Performance

CoinGecko Free Tier

  • 50 requests/minute β€” More than enough for typical watchlists
  • With 10 coins checked every 5 minutes β†’ 2 req/min average
  • No API key required for basic usage

CoinGecko Pro Tier (optional)

  • 300 requests/minute β€” For large watchlists or more frequent checks
  • Set COINGECKO_API_KEY environment variable

Resource Usage

  • CPU: Minimal (curl + jq scripts)
  • Memory: ~50MB (agent overhead)
  • Network: ~10KB per price check

🎨 Customization Ideas

Adjust Alert Sensitivity

Edit HEARTBEAT.md to change thresholds:

- If price moved >3% (was 5%): IMPORTANT alert
- If price moved >15% (was 20%): URGENT alert

Add More Coins

CoinGecko supports 10,000+ coins. Find IDs at: https://api.coingecko.com/api/v3/coins/list

Multi-Timeframe Analysis

Modify skills/coingecko/fetch-price.sh to include 1h, 7d, 30d changes.

Export Price History

Add a skill to write daily price snapshots to memory/price-history/YYYY-MM-DD.json.

πŸ› Troubleshooting

Agent isn't sending alerts

  • Check heartbeat is enabled in OpenClaw config
  • Verify watchlist.json has valid coin IDs
  • Ensure prices are actually moving enough to cross thresholds
  • Check logs: docker logs openclaw

"Rate limit exceeded" errors

  • You're checking too many coins too frequently
  • Add a Pro API key, or reduce check frequency to every 10 minutes

Coin not found

  • Verify the coin ID at https://api.coingecko.com/api/v3/coins/list
  • Use the exact id field (not symbol)
  • Example: Use "bitcoin" not "BTC"

πŸ“š Learn More

πŸ“„ License

MIT License - Free to use and modify

🀝 Contributing

Found a bug or have an enhancement? Open an issue or PR on the Hatchery registry.


Built with OpenClaw β€” Self-hosted AI agents that actually work for you.

Deploy to Hosted

Stats

Downloads0
Deployments0
Latest Version1.0.0
Runtime SupportAny
Size20.4 KB

Versions

1.0.0about 2 months ago