kraken-alert-patterns
Price alerts, threshold monitoring, and notification triggers for agents.
Handle order failures, network errors, and duplicate submissions safely.
Claude Code
$ npx -y skills add krakenfx/kraken-cli --skill kraken-error-recovery --agent claude-code
Codex
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a codex -y
Cursor
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a cursor -y
Gemini CLI
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a gemini-cli -y
GitHub Copilot
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a github-copilot -y
OpenCode
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a opencode -y
Windsurf
$ npx skills add krakenfx/kraken-cli --skill kraken-error-recovery -a windsurf -y
name: kraken-error-recovery
version: 1.0.0
description: "Handle order failures, network errors, and duplicate submissions safely."
metadata:
openclaw:
category: "finance"
requires:
bins: ["kraken"]
skills: ["kraken-shared"]Use this skill for:
Parse the `.error` field from the JSON response:
| Category | Meaning | Recovery | |----------|---------|----------| | `auth` | Credentials invalid or expired | Re-authenticate, do not retry | | `rate_limit` | Too many requests | Read `suggestion` and `docs_url` fields, adapt strategy | | `network` | Connection failed, or the response was lost after sending (`verify_first: true`) | Retry with backoff; with `verify_first`, see Duplicate Order Prevention | | `validation` | Invalid request parameters | Fix inputs, do not retry unchanged | | `api` | Exchange-side rejection | Inspect error message, adjust request |
After a network error during order submission (`"verify_first": true`), the order may or may not have reached the exchange. Check before resubmitting:
kraken open-orders -o json 2>/dev/null
If the order appears in open-orders, do not resubmit. If absent:
kraken trades-history -o json 2>/dev/null
If the order filled immediately, it appears in trades. Only resubmit if the order is absent from both.
Use `--cl-ord-id` to tag orders with a unique identifier:
kraken order buy BTCUSD 0.001 --type limit --price 50000 --cl-ord-id "dca-2024-01-15-001" -o json 2>/dev/null
If the submission fails, query by client order ID to check if it reached the exchange:
kraken open-orders --cl-ord-id "dca-2024-01-15-001" -o json 2>/dev/null
Cancel by client order ID if needed:
kraken order cancel --cl-ord-id "dca-2024-01-15-001" -o json 2>/dev/null
1. Submit order (capture exit code and response) 2. If exit code != 0 and error == "network": a. Wait 2 seconds b. Check open-orders for the order (by cl-ord-id or recent orders) c. If found → order succeeded, proceed d. If not found → check trades-history e. If in trades → order filled, proceed f. If absent from both → safe to retry 3. Retry with same cl-ord-id
The CLI returns rate limit errors immediately with no internal retry. The error includes actionable fields for the agent to decide next steps.
On `rate_limit` error:
1. Read the `suggestion` field for specific guidance on what limit was hit and how to adapt. 2. Read the `docs_url` field for the relevant Kraken documentation. 3. Decide whether to retry (and when), reduce request frequency, or switch to WebSocket streaming for real-time data. 4. Resume with a single test call before continuing the loop.
# { "error": "rate_limit", "suggestion": "...", "docs_url": "...", "retryable": true }
kraken status -o json 2>/dev/nullIf status succeeds, the rate limit has cleared.
Limit orders may partially fill. Check order status:
kraken query-orders <TXID> -o json 2>/dev/null
The result is keyed by txid. Fields: `volume` (requested volume), `volume_executed` (filled volume), `status` (`open`, `closed`, `canceled`, `expired`, ...). `query-orders`, `open-orders` and `closed-orders` publish the same order shape.
If partially filled and the remaining volume is needed, amend or place a new order for the remaining amount.
An order stuck in `open` state that should have filled or been canceled:
1. Check the order:
kraken query-orders <TXID> -o json 2>/dev/null
2. If still open, cancel:
kraken order cancel <TXID> -o json 2>/dev/null
3. Verify cancellation:
kraken open-orders -o json 2>/dev/null
Trade on Kraken from your terminal, or let your AI agent trade for you. One install covers crypto, tokenized U.S. stocks and ETFs (for non-U.S. customers), forex, and futures. Every command can answer in JSON.
Price alerts, threshold monitoring, and notification triggers for agents.
Progress from manual trading to full agent autonomy with controlled risk at each level.
Capture the spot-futures price spread with delta-neutral basis trades.
Dollar cost averaging with scheduled buys and performance tracking.
Discover staking strategies, allocate funds, and track earn positions.
Minimize trading fees through maker orders, volume tiers, and fee-aware execution.
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…