kraken-alert-patterns
Price alerts, threshold monitoring, and notification triggers for agents.
Portfolio rebalancing to maintain target allocations across assets.
Claude Code
$ npx -y skills add krakenfx/kraken-cli --skill kraken-rebalancing --agent claude-code
Codex
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a codex -y
Cursor
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a cursor -y
Gemini CLI
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a gemini-cli -y
GitHub Copilot
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a github-copilot -y
OpenCode
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a opencode -y
Windsurf
$ npx skills add krakenfx/kraken-cli --skill kraken-rebalancing -a windsurf -y
name: kraken-rebalancing
version: 1.0.0
description: "Portfolio rebalancing to maintain target allocations across assets."
metadata:
openclaw:
category: "finance"
requires:
bins: ["kraken"]Use this skill for:
Example target: 50% BTC, 30% ETH, 20% SOL (by USD value).
The agent maintains these weights and compares against current holdings.
1. Get balances:
kraken balance -o json 2>/dev/null
2. Get current prices for all held assets:
kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null
3. Calculate USD value of each holding and total portfolio value. 4. Compute current weights: asset_value / total_value for each.
For each asset:
Set a minimum trade threshold (e.g., $50) to avoid placing tiny orders that waste fees.
kraken workspace create sandbox --capital 10000 --mode paper -o json 2>/dev/null export KRAKEN_WORKSPACE=sandbox # Initial buys to establish positions kraken paper buy BTCUSD 0.05 -o json 2>/dev/null kraken paper buy ETHUSD 1.0 -o json 2>/dev/null kraken paper buy SOLUSD 10 -o json 2>/dev/null kraken workspace status -o json 2>/dev/null # After price drift, rebalance # Sell overweight asset, buy underweight asset kraken paper sell BTCUSD 0.005 -o json 2>/dev/null kraken paper buy SOLUSD 2 -o json 2>/dev/null kraken workspace status -o json 2>/dev/null
Live orders run outside the paper workspace, so run `unset KRAKEN_WORKSPACE` first. Inside it, the orders fill on paper and `kraken balance` reads the paper ledger.
1. Calculate all required trades. 2. Present the rebalance plan to the user:
3. Validate each order:
kraken order sell BTCUSD 0.005 --type market --validate -o json 2>/dev/null kraken order buy SOLUSD 2 --type market --validate -o json 2>/dev/null
4. Execute sells first (to free capital), then buys (requires human approval):
kraken order sell BTCUSD 0.005 --type market -o json 2>/dev/null kraken order buy SOLUSD 2 --type market -o json 2>/dev/null
5. Verify final state:
kraken balance -o json 2>/dev/null
Periodically compare current weights to targets. Trigger rebalance when any asset drifts beyond a threshold (e.g., 5% absolute drift):
# Agent checks balance and prices on a schedule # If |current_weight - target_weight| > 0.05 for any asset → rebalance
For lower fees, use limit orders instead of market:
PRICE=$(kraken ticker SOLUSD -o json 2>/dev/null | jq -r '.[].ask_price') kraken order buy SOLUSD 2 --type limit --price $PRICE -o json 2>/dev/null
Check fills before declaring rebalance complete:
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.
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) .…