kraken-alert-patterns
Price alerts, threshold monitoring, and notification triggers for agents.
Prevent futures liquidation through margin monitoring and emergency procedures.
Claude Code
$ npx -y skills add krakenfx/kraken-cli --skill kraken-liquidation-guard --agent claude-code
Codex
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a codex -y
Cursor
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a cursor -y
Gemini CLI
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a gemini-cli -y
GitHub Copilot
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a github-copilot -y
OpenCode
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a opencode -y
Windsurf
$ npx skills add krakenfx/kraken-cli --skill kraken-liquidation-guard -a windsurf -y
name: kraken-liquidation-guard
version: 1.0.0
description: "Prevent futures liquidation through margin monitoring and emergency procedures."
metadata:
openclaw:
category: "finance"
requires:
bins: ["kraken"]
skills: ["kraken-futures-risk"]Use this skill for:
kraken futures accounts -o json 2>/dev/null
Key fields of the multi-collateral account, under `.accounts.flex`:
Margin ratio = `.accounts.flex.maintenanceMargin / .accounts.flex.marginEquity`. Liquidation approaches as this ratio nears 1.0. A single-collateral account (`.accounts.fi_*`) reports maintenance margin, portfolio value and available funds as `marginRequirements.mm`, `auxiliary.pv` and `auxiliary.af`.
| Ratio | Status | Action | |-------|--------|--------| | < 0.3 | Healthy | Normal operation | | 0.3 - 0.5 | Caution | Reduce position or add margin | | 0.5 - 0.7 | Warning | Reduce position immediately | | > 0.7 | Critical | Emergency flatten |
kraken futures ws balances -o json 2>/dev/null | while read -r line; do # Read margin equity and maintenance margin from the frame # Calculate ratio # Alert or act when threshold is breached done
Or poll periodically:
kraken futures accounts -o json 2>/dev/null
If a position enters the unwind queue, liquidation is imminent:
kraken futures unwind-queue -o json 2>/dev/null
Any result here requires immediate action.
Cancel all open orders, then close all positions:
# Cancel all orders to free held margin kraken futures cancel-all --yes -o json 2>/dev/null # Close each position with reduce-only market orders kraken futures positions -o json 2>/dev/null # For each position: kraken futures order sell PF_XBTUSD <SIZE> --type market --reduce-only -o json 2>/dev/null
Transfer funds from spot wallet to futures to increase margin:
kraken futures transfer 5000 USD -o json 2>/dev/null
Or from main account:
kraken wallet-transfer USD 5000 --from <SPOT_IIBAN> --to <FUTURES_IIBAN> -o json 2>/dev/null
Lower leverage to reduce margin requirements:
kraken futures set-leverage PF_XBTUSD 2 -o json 2>/dev/null
Always run a dead man's switch during futures sessions:
kraken futures cancel-after 600 -o json 2>/dev/null
If the agent crashes, orders auto-cancel, preventing further margin consumption.
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.
Handle order failures, network errors, and duplicate submissions safely.
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) .…