Agent Skillskrakenfx/kraken-cli › kraken-alert-patterns

kraken-alert-patterns

GitHub

提供Kraken交易所监控技能,支持价格、价差、成交量及账户状态等阈值警报,涵盖轮询与流式处理模式,用于构建通知驱动的交易代理工作流。

skills/kraken-alert-patterns/SKILL.md krakenfx/kraken-cli

Trigger Scenarios

设置加密货币价格监控 检测市场异常波动 配置交易账户安全警报

Install

npx skills add krakenfx/kraken-cli --skill kraken-alert-patterns -g -y
More Options

Use without installing

npx skills use krakenfx/kraken-cli@kraken-alert-patterns

指定 Agent (Claude Code)

npx skills add krakenfx/kraken-cli --skill kraken-alert-patterns -a claude-code -g -y

安装 repo 全部 skill

npx skills add krakenfx/kraken-cli --all -g -y

预览 repo 内 skill

npx skills add krakenfx/kraken-cli --list

SKILL.md

Frontmatter
{
    "name": "kraken-alert-patterns",
    "version": "1.0.0",
    "metadata": {
        "openclaw": {
            "category": "finance"
        },
        "requires": {
            "bins": [
                "kraken"
            ]
        }
    },
    "description": "Price alerts, threshold monitoring, and notification triggers for agents."
}

kraken-alert-patterns

Use this skill for:

  • monitoring price levels and triggering alerts
  • detecting spread widening, volume spikes, and volatility shifts
  • watching account state changes (fills, balance drops)
  • building notification-driven agent workflows

Price Alert (Polling)

Check price at intervals and compare against thresholds:

PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].last_price')
# Agent compares $PRICE to upper/lower thresholds
# If breached, notify the user

Price Alert (Streaming)

More efficient for continuous monitoring. The agent reads the stream and fires when conditions are met:

kraken ws ticker BTC/USD -o json 2>/dev/null | while read -r line; do
  LAST=$(echo "$line" | jq -r '.data[0].last // empty')
  [ -z "$LAST" ] && continue
  # Compare against thresholds, break or notify on breach
done

Spread Alert

Detect when the bid-ask spread widens beyond a threshold (liquidity warning):

kraken ws ticker BTC/USD --event-trigger bbo -o json 2>/dev/null | while read -r line; do
  ASK=$(echo "$line" | jq -r '.data[0].ask // empty')
  BID=$(echo "$line" | jq -r '.data[0].bid // empty')
  [ -z "$ASK" ] || [ -z "$BID" ] && continue
  SPREAD=$(echo "$ASK - $BID" | bc)
  # Alert if spread exceeds threshold
done

Volume Spike Detection

Compare current 24h volume against a baseline:

kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].volume_24h'
# Agent compares to historical average
# Alert if volume > 2x baseline

Volatility Alert (OHLC-Based)

Read recent candles and compute range or standard deviation:

kraken ohlc BTCUSD --interval 60 -o json 2>/dev/null
# Agent calculates high-low range per candle
# Alert if range exceeds threshold

Balance Change Alert

Monitor for unexpected balance changes:

INITIAL=$(kraken balance -o json 2>/dev/null | jq -r '.USD // "0"')
# On each check:
CURRENT=$(kraken balance -o json 2>/dev/null | jq -r '.USD // "0"')
# Alert if |CURRENT - INITIAL| exceeds threshold

Streaming alternative:

kraken ws balances -o json 2>/dev/null
# Each line is a balance update event

Fill Notification

Alert on trade executions:

kraken ws executions -o json 2>/dev/null | while read -r line; do
  TYPE=$(echo "$line" | jq -r '.data[0].exec_type // empty')
  [ "$TYPE" = "trade" ] && echo "Fill: $line"
done

Futures Alerts

Monitor futures positions for margin or P&L thresholds:

kraken futures positions -o json 2>/dev/null
# Agent checks unrealized P&L against stop-loss threshold

Stream futures balance changes:

kraken futures ws balances -o json 2>/dev/null

Futures notifications (margin calls, liquidation warnings):

kraken futures ws notifications -o json 2>/dev/null

Multi-Pair Alert

Watch several pairs and alert on the first one that hits a condition:

kraken ws ticker BTC/USD ETH/USD SOL/USD -o json 2>/dev/null | while read -r line; do
  PAIR=$(echo "$line" | jq -r '.data[0].symbol // empty')
  LAST=$(echo "$line" | jq -r '.data[0].last // empty')
  [ -z "$PAIR" ] || [ -z "$LAST" ] && continue
  # Check pair-specific thresholds
done

Notification Delivery

The CLI outputs alerts to stdout. The agent is responsible for delivering notifications through its own channels (Slack, email, push notification, or presenting to the user in chat).

Pattern Summary

Condition Method Command
Price crosses level Stream ws ticker <PAIR>
Spread widens Stream ws ticker <PAIR> --event-trigger bbo
Volume spike Poll ticker <PAIR>
Balance change Stream ws balances
Trade fill Stream ws executions
Futures margin Stream futures ws balances
Futures notification Stream futures ws notifications

Hard Rules

  • Alerts are informational; they do not execute trades automatically.
  • Prefer streaming over high-frequency polling to reduce API load.
  • Close streams when monitoring is no longer needed.
  • If you hit a mismatch between what you are trying to do and the CLI's interface or responses — including a mismatch between this skill and the installed CLI version's contract — feel free to submit feedback with kraken feedback.

Version History

  • aa56e59 Current 2026-08-20 04:44

    更新价格提取字段为last_price;新增Spread、Volume、Volatility、Balance、Fill及Futures等多维度警报示例;完善多币种监控逻辑。

  • aa32814 2026-07-25 10:27

Same Skill Collection

skills/kraken-autonomy-levels/SKILL.md
skills/kraken-basis-trading/SKILL.md
skills/kraken-dca-strategy/SKILL.md
skills/kraken-earn-staking/SKILL.md
skills/kraken-error-recovery/SKILL.md
skills/kraken-fee-optimization/SKILL.md
skills/kraken-funding-carry/SKILL.md
skills/kraken-funding-ops/SKILL.md
skills/kraken-futures-risk/SKILL.md
skills/kraken-grid-trading/SKILL.md
skills/kraken-lab-experiment/SKILL.md
skills/kraken-liquidation-guard/SKILL.md
skills/kraken-market-intel/SKILL.md
skills/kraken-mcp-integration/SKILL.md
skills/kraken-multi-pair/SKILL.md
skills/kraken-order-types/SKILL.md
skills/kraken-paper-strategy/SKILL.md
skills/kraken-paper-to-live/SKILL.md
skills/kraken-playground/SKILL.md
skills/kraken-portfolio-intel/SKILL.md
skills/kraken-rate-limits/SKILL.md
skills/kraken-rebalancing/SKILL.md
skills/kraken-risk-operations/SKILL.md
skills/kraken-setup/SKILL.md
skills/kraken-spot-execution/SKILL.md
skills/kraken-stop-take-profit/SKILL.md
skills/kraken-subaccount-ops/SKILL.md
skills/kraken-tax-export/SKILL.md
skills/kraken-twap-execution/SKILL.md
skills/kraken-ws-streaming/SKILL.md
skills/recipe-basis-trade-entry/SKILL.md
skills/recipe-daily-pnl-report/SKILL.md
skills/recipe-drawdown-circuit-breaker/SKILL.md
skills/recipe-earn-yield-compare/SKILL.md
skills/recipe-emergency-flatten/SKILL.md
skills/recipe-fee-tier-progress/SKILL.md
skills/recipe-funding-rate-scan/SKILL.md
skills/recipe-futures-hedge-spot/SKILL.md
skills/recipe-launch-grid-bot/SKILL.md
skills/recipe-morning-market-brief/SKILL.md
skills/recipe-multi-pair-breakout-watch/SKILL.md
skills/recipe-paper-strategy-backtest/SKILL.md
skills/recipe-playground-dca-triggered/SKILL.md
skills/recipe-playground-dca/SKILL.md
skills/recipe-playground-price-alert/SKILL.md
skills/recipe-playground-rebalance/SKILL.md
skills/recipe-playground-webhook/SKILL.md
skills/recipe-portfolio-snapshot-csv/SKILL.md
skills/recipe-price-level-alerts/SKILL.md

Metadata

Files
0
Version
aa56e59
Hash
6eb8f7e8
Indexed
2026-07-25 10:27

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 10:10
浙ICP备14020137号-1 $Гость$