← 返回 Skills 市场
yongtaop1-sys

Crypto Price Monitor

作者 yongtaop1-sys · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
158
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install crypto-price-monitor
功能描述
Monitor cryptocurrency prices and trigger alerts when thresholds are hit. Supports BTC, ETH, SOL, and 100+ other coins via CoinGecko API. Configure price cei...
使用说明 (SKILL.md)

Crypto Price Alerts

Monitor cryptocurrency prices and get alerts when targets are hit. No API key required — uses CoinGecko's free API.

What It Does

  • Checks current prices for BTC, ETH, SOL, and 100+ coins
  • Compares against your configured thresholds
  • Alerts when price crosses above/below targets
  • Supports percentage moves (e.g., "alert if BTC drops 5% in 1 hour")
  • Can run once or on a schedule (cron)

Quick Start

Check a Single Price

# Direct API call (no auth needed)
curl "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana&vs_currencies=usd&include_24hr_change=true"

Check with More Detail

curl "https://api.coingecko.com/api/v3/coins/bitcoin?localization=false&tickers=false&community_data=false&developer_data=false&sparkline=false"

Alert Configuration

Create a crypto-alerts.json file:

{
  "alerts": [
    {
      "coin": "bitcoin",
      "symbol": "btc",
      "condition": "below",
      "price": 85000,
      "message": "BTC dropped below $85K!"
    },
    {
      "coin": "bitcoin",
      "symbol": "btc",
      "condition": "above",
      "price": 100000,
      "message": "BTC crossed $100K! 🚀"
    },
    {
      "coin": "ethereum",
      "symbol": "eth",
      "condition": "below",
      "price": 3000,
      "message": "ETH below $3K"
    },
    {
      "coin": "solana",
      "symbol": "sol",
      "condition": "above",
      "price": 200,
      "message": "SOL above $200!"
    }
  ],
  "telegram_bot_token": "YOUR_BOT_TOKEN",
  "telegram_chat_id": "YOUR_CHAT_ID"
}

Python Alert Script

Save as crypto_alert.py:

#!/usr/bin/env python3
import requests
import json
import sys
import os
from datetime import datetime

COINGECKO_API = "https://api.coingecko.com/api/v3"

def get_price(coin_id):
    url = f"{COINGECKO_API}/simple/price"
    params = {
        "ids": coin_id,
        "vs_currencies": "usd",
        "include_24hr_change": "true",
        "include_last_updated_at": "true"
    }
    r = requests.get(url, params=params, timeout=10)
    r.raise_for_status()
    data = r.json()
    return data[coin_id]["usd"], data[coin_id].get("usd_24h_change", 0)

def check_alerts(alerts_config):
    triggered = []
    for alert in alerts_config.get("alerts", []):
        coin = alert["coin"]
        condition = alert["condition"]
        target = alert["price"]
        message = alert["message"]
        
        try:
            price, change_24h = get_price(coin)
        except Exception as e:
            print(f"Error fetching {coin}: {e}")
            continue
        
        should_fire = False
        if condition == "above" and price >= target:
            should_fire = True
        elif condition == "below" and price \x3C= target:
            should_fire = True
        
        if should_fire:
            triggered.append({
                "coin": coin,
                "price": price,
                "target": target,
                "condition": condition,
                "message": message,
                "change_24h": change_24h,
                "time": datetime.now().isoformat()
            })
            print(f"🚨 ALERT: {message} (Current: ${price:,.2f})")
        else:
            print(f"  {coin.upper()}: ${price:,.2f} (24h: {change_24h:+.2f}%) — {condition} ${target:,.2f}: {'✓' if should_fire else 'not triggered'}")
    
    return triggered

def send_telegram(message, bot_token, chat_id):
    if not bot_token or not chat_id:
        return
    url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
    payload = {"chat_id": chat_id, "text": message, "parse_mode": "HTML"}
    requests.post(url, json=payload, timeout=10)

if __name__ == "__main__":
    config_path = os.path.join(os.path.dirname(__file__), "crypto-alerts.json")
    
    if len(sys.argv) > 1:
        config_path = sys.argv[1]
    
    if os.path.exists(config_path):
        with open(config_path) as f:
            config = json.load(f)
    else:
        print("No crypto-alerts.json found. Using default BTC/ETH/SOL check.")
        config = {
            "alerts": [
                {"coin": "bitcoin", "symbol": "btc", "condition": "above", "price": 0},
                {"coin": "ethereum", "symbol": "eth", "condition": "above", "price": 0},
                {"coin": "solana", "symbol": "sol", "condition": "above", "price": 0}
            ]
        }
    
    triggered = check_alerts(config)
    
    if triggered:
        summary = "🚨 \x3Cb>Crypto Alert Triggered\x3C/b>\
\
"
        for t in triggered:
            summary += f"{t['message']}\
"
            summary += f"Price: ${t['price']:,.2f} | 24h: {t['change_24h']:+.2f}%\
\
"
        
        bot_token = config.get("telegram_bot_token")
        chat_id = config.get("telegram_chat_id")
        if bot_token and chat_id:
            send_telegram(summary, bot_token, chat_id)
        
        with open("/tmp/crypto_alerts_triggered.json", "a") as f:
            f.write(json.dumps({"triggered": triggered, "time": datetime.now().isoformat()}) + "\
")

Usage Examples

Run Once

python3 crypto_alert.py

Run on Schedule (Cron)

# Every 15 minutes
*/15 * * * * cd /path/to/skill && python3 crypto_alert.py >> /tmp/crypto_alerts.log 2>&1

# Every hour at minute 0
0 * * * * cd /path/to/skill && python3 crypto_alert.py >> /tmp/crypto_alerts.log 2>&1

Check Specific Coin

# Bitcoin
curl "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true"

# Multiple coins
curl "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana,cardano,polkadot,avalanche-2,chainlink&vs_currencies=usd&include_24hr_change=true"

Supported Coins (Common IDs)

Symbol CoinGecko ID
BTC bitcoin
ETH ethereum
SOL solana
ADA cardano
DOT polkadot
AVAX avalanche-2
LINK chainlink
XRP ripple
DOGE dogecoin
MATIC polygon
ARB arbitrum
OP optimism

For full list: curl https://api.coingecko.com/api/v3/coins/list?per_page=250

Alert Conditions

  • above — Fire when price >= target
  • below — Fire when price \x3C= target
  • percent_up — Fire when 24h change > X% (add percent_threshold field)
  • percent_down — Fire when 24h change \x3C -X% (add percent_threshold field)

Rate Limits

CoinGecko free API:

  • ~10-30 calls/minute
  • 10,000-50,000 calls/month
  • Use caching if checking frequently
  • Add sleep(1.2) between calls to be safe

Requirements

  • requests Python library (pip install requests)
  • CoinGecko API (free, no key needed)
  • Optional: Telegram bot for push notifications
  • Optional: cron for scheduled monitoring

Tips

  1. Don't spam checks — 15-minute intervals are fine for most use cases
  2. Cache prices — Store last check to avoid redundant API calls
  3. Multiple conditions — One coin can have multiple alerts (above AND below)
  4. Logging — Always log to a file so you can review what fired

Based on real crypto monitoring work. CoinGecko API is free but respectful usage is expected.

安全使用建议
This appears to be a straightforward CoinGecko-based alert script. Before installing/running: 1) Inspect which crypto_alert.py you will execute (manifest vs SKILL.md differ — confirm whether the script writes to /tmp and that this behavior is acceptable). 2) Do not commit your Telegram bot token/chat_id into public repos; store the config file with restrictive permissions or supply tokens at runtime. 3) Ensure Python and the 'requests' package are installed (the skill does not declare dependencies). 4) Be aware the script makes outbound HTTP requests to api.coingecko.com and api.telegram.org; run it in an environment where that network activity is acceptable. 5) If running on a schedule (cron), redirect logs to a path you control and monitor disk usage of any files the script writes. If you want stricter secret handling, modify the script to read the Telegram token from a protected environment variable rather than a plain JSON file.
功能分析
Type: OpenClaw Skill Name: crypto-price-monitor Version: 1.0.0 The skill bundle provides a standard cryptocurrency price monitoring tool using the public CoinGecko API. The Python script (crypto_alert.py) and documentation (SKILL.md) perform legitimate functions such as fetching price data, comparing it against user-defined thresholds, and optionally sending alerts via Telegram using user-provided credentials. No evidence of malicious intent, data exfiltration, or prompt injection was found.
能力评估
Purpose & Capability
The name/description (monitor crypto prices, trigger alerts, optional Telegram delivery) matches the included instructions and Python script: it polls CoinGecko, compares thresholds, prints alerts, and can POST to Telegram. No unrelated credentials or platform access are requested.
Instruction Scope
Instructions and code stay within the stated purpose (fetch prices from CoinGecko, evaluate alerts, deliver to console/Telegram). Minor inconsistency: the SKILL.md's embedded script writes triggered alerts to /tmp/crypto_alerts_triggered.json, whereas the included crypto_alert.py file in the manifest (the delivered code) does not include that /tmp write — verify which version you run. Both versions only reference local config and make outbound network calls to CoinGecko and Telegram.
Install Mechanism
No install spec (instruction-only + included script) — lowest install risk. The script requires the Python 'requests' library but the skill does not declare dependencies; user must ensure Python+requests are available.
Credentials
No required environment variables or unrelated credentials are requested. Telegram bot token and chat ID are optional fields in the local JSON config (expected and proportionate). The skill does not request additional secrets or system credentials.
Persistence & Privilege
Skill is not always-enabled and does not request elevated or persistent platform privileges. It runs as a local script and (per SKILL.md) may be scheduled via cron — expected for this use case.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install crypto-price-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /crypto-price-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - Monitor crypto prices via CoinGecko API, trigger alerts with Telegram support
元数据
Slug crypto-price-monitor
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Crypto Price Monitor 是什么?

Monitor cryptocurrency prices and trigger alerts when thresholds are hit. Supports BTC, ETH, SOL, and 100+ other coins via CoinGecko API. Configure price cei... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 158 次。

如何安装 Crypto Price Monitor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install crypto-price-monitor」即可一键安装,无需额外配置。

Crypto Price Monitor 是免费的吗?

是的,Crypto Price Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Crypto Price Monitor 支持哪些平台?

Crypto Price Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Crypto Price Monitor?

由 yongtaop1-sys(@yongtaop1-sys)开发并维护,当前版本 v1.0.0。

💬 留言讨论