📈 Crypto Alert Agent
Stay ahead of the market with the Crypto Alert Agent. This skill provides real-time price alerts, portfolio tracking, and instant notifications through Telegram, ensuring you never miss a critical market movement.
Supported cryptocurrencies include BTC, ETH, SOL, and many more via the CoinGecko API.
1. Features
- - Price Alerts: Set custom price thresholds for any supported cryptocurrency. Get notified when the price goes above or below your target.
- Portfolio Tracking: Add your crypto holdings to track their total value in real-time.
- Telegram Notifications: Receive all alerts and updates directly in your Telegram chat for immediate action.
- On-Demand Price Checks: Instantly fetch the current price of any cryptocurrency.
2. Setup
Before using the agent, you need to configure your Telegram notifications.
- 1. Get your Telegram Chat ID:
- Talk to the
@userinfobot on Telegram.
- It will give you your unique Chat ID.
- 2. Set up Credentials:
- Create a file named
telegram_chat_id inside the
{baseDir}/credentials/ directory.
- Paste your Chat ID into this file.
- Ensure your OpenClaw instance is configured with a Telegram bot token that has permission to send you messages.
3. Usage
The agent can be managed through a simple command-line interface. All commands are executed via the run.sh script.
3.1 Price Alerts
Add a Price Alert
Set an alert for a specific coin when it crosses a target price.
Command:
CODEBLOCK0
- -
--coin <id>: The CoinGecko API ID for the cryptocurrency (e.g., bitcoin, ethereum, solana). - INLINECODE8 : Notify when the price is
above or below the target. - INLINECODE11 : The target price in USD.
Example:
CODEBLOCK1
List Active Alerts
View all the price alerts you have currently set.
CODEBLOCK2
Remove a Price Alert
Delete an active alert using its ID (you can get the ID from the
list command).
CODEBLOCK3
3.2 Portfolio Tracking
Add a Holding to Your Portfolio
Add a coin and the amount you hold to your portfolio.
Command:
CODEBLOCK4
- -
--coin <id>: The CoinGecko API ID of the coin. - INLINECODE14 : The number of coins you hold.
Example:
CODEBLOCK5
View Your Portfolio
Get a summary of your current holdings and their total value in USD.
CODEBLOCK6
Remove a Holding from Your Portfolio
Remove a coin from your portfolio using its ID.
CODEBLOCK7
3.3 Check Price
Get the current price of one or more cryptocurrencies instantly.
Command:
CODEBLOCK8
- -
--coins <id1,id2,...>: A comma-separated list of CoinGecko API IDs.
Example:
bash {baseDir}/run.sh price --coins bitcoin,ethereum,solana
4. Automation (Agent Logic)
This skill is designed to be run on a schedule (e.g., via a cron job or a persistent agent loop) to check for alert conditions.
Recommended Automation Schedule: Every 5 minutes.
Example Cron Job:
CODEBLOCK10
The agent run command will:
- 1. Fetch the latest prices for all coins in active alerts and the portfolio.
- Check if any price alert conditions have been met.
- If an alert is triggered, send a notification to the configured Telegram chat ID and remove the alert to avoid spam.
- (Optional) Send a periodic portfolio value update.
📈 加密货币提醒助手
通过加密货币提醒助手,始终领先市场一步。该技能提供实时价格提醒、投资组合追踪以及通过Telegram发送的即时通知,确保您不会错过任何关键市场动态。
支持的加密货币包括BTC、ETH、SOL等,数据通过CoinGecko API获取。
1. 功能特性
- - 价格提醒:为任何支持的加密货币设置自定义价格阈值。当价格高于或低于目标时,您将收到通知。
- 投资组合追踪:添加您的加密货币持仓,实时追踪总价值。
- Telegram通知:所有提醒和更新直接发送至您的Telegram聊天窗口,便于即时操作。
- 即时价格查询:快速获取任意加密货币的当前价格。
2. 设置
在使用该助手之前,您需要配置Telegram通知。
- 1. 获取您的Telegram聊天ID:
- 在Telegram中与@userinfobot对话。
- 它将为您提供唯一的聊天ID。
- 2. 配置凭证:
- 在{baseDir}/credentials/目录下创建一个名为telegram
chatid的文件。
- 将您的聊天ID粘贴到该文件中。
- 确保您的OpenClaw实例已配置具有向您发送消息权限的Telegram机器人令牌。
3. 使用方法
该助手可通过简单的命令行界面进行管理。所有命令均通过run.sh脚本执行。
3.1 价格提醒
添加价格提醒
为特定币种设置当价格达到目标时的提醒。
命令:
bash
bash {baseDir}/run.sh alert add --coin --condition --price
- - --coin :加密货币的CoinGecko API ID(例如:bitcoin、ethereum、solana)。
- --condition :当价格高于或低于目标时通知。
- --price :以美元计价的目标价格。
示例:
bash
当比特币价格超过75,000美元时提醒我
bash {baseDir}/run.sh alert add --coin bitcoin --condition above --price 75000
当Solana价格跌破150美元时提醒我
bash {baseDir}/run.sh alert add --coin solana --condition below --price 150
查看活跃提醒
查看您当前设置的所有价格提醒。
bash
bash {baseDir}/run.sh alert list
删除价格提醒
使用提醒ID删除一个活跃提醒(您可以通过list命令获取ID)。
bash
bash {baseDir}/run.sh alert remove --id
3.2 投资组合追踪
向投资组合添加持仓
添加您持有的币种及数量到投资组合。
命令:
bash
bash {baseDir}/run.sh portfolio add --coin --amount
- - --coin :币种的CoinGecko API ID。
- --amount :您持有的币种数量。
示例:
bash
bash {baseDir}/run.sh portfolio add --coin ethereum --amount 2.5
查看投资组合
获取您当前持仓的摘要及其美元总价值。
bash
bash {baseDir}/run.sh portfolio view
从投资组合中移除持仓
使用持仓ID从投资组合中移除一个币种。
bash
bash {baseDir}/run.sh portfolio remove --id
3.3 查询价格
即时获取一个或多个加密货币的当前价格。
命令:
bash
bash {baseDir}/run.sh price --coins
- - --coins :以逗号分隔的CoinGecko API ID列表。
示例:
bash
bash {baseDir}/run.sh price --coins bitcoin,ethereum,solana
4. 自动化(助手逻辑)
该技能设计为按计划运行(例如通过cron作业或持久的助手循环),以检查提醒条件。
推荐自动化计划: 每5分钟一次。
示例Cron作业:
cron
/5 * /path/to/your/workspace/skills/crypto-alert-agent/run.sh agent run
agent run命令将:
- 1. 获取所有活跃提醒和投资组合中币种的最新价格。
- 检查是否有任何价格提醒条件被触发。
- 如果提醒被触发,向配置的Telegram聊天ID发送通知,并移除该提醒以避免重复通知。
- (可选)发送定期投资组合价值更新。