Kraken CLI logo

Kraken CLI

2

Agent-first CLI for trading crypto, stocks, forex, and derivatives on Kraken. Paper trading by default; live trading opt-in via API keys.

51 skills

kraken-tax-export

Export trade history, ledgers, and cost basis data for tax reporting.

# kraken-tax-export Use this skill for: - exporting trades and ledgers for tax preparation - generating CSV exports for import into tax software - computing realized gains from trade history - auditing deposits and withdrawals for completeness ## Trade Export Request a full trade export for a tax year: ```bash kraken export-report --report trades --description "2024 tax year" --format CSV --starttm 1704067200 --endtm 1735689600 -o json 2>/dev/null ``` Check status: ```bash kraken export-status --report trades -o json 2>/dev/null ``` Download when ready: ```bash kraken export-retrieve <REPORT_ID> -o json 2>/dev/null ``` Clean up after download: ```bash kraken export-delete <REPORT_ID> -o json 2>/dev/null ``` ## Ledger Export Ledgers capture all account activity (trades, deposits, withdrawals, staking rewards, fees): ```bash kraken export-report --report ledgers --description "2024 full ledger" --format CSV --starttm 1704067200 --endtm 1735689600 -o json 2>/dev/null ``` ## JSON Trade History (Alternative) For smaller date ranges, query directly: ```bash kraken trades-history --ledgers --consolidate-taker -o json 2>/dev/null ``` Filter by time: ```bash kraken closed-orders --start 1704067200 --end 1735689600 -o json 2>/dev/null ``` ## Futures History Futures trades are exported separately: ```bash kraken futures history-executions --since 2024-01-01T00:00:00Z --before 2025-01-01T00:00:00Z --sort asc -o json 2>/dev/null ``` Futures account log (CSV): ```bash kraken futures history-account-log-csv --since 2024-01-01T00:00:00Z --before 2025-01-01T00:00:00Z -o json 2>/dev/null ``` ## Deposit and Withdrawal Records Complete picture for tax reconciliation: ```bash kraken deposit status --start 1704067200 --end 1735689600 -o json 2>/dev/null kraken withdrawal status --start 1704067200 --end 1735689600 -o json 2>/dev/null ``` ## Earn/Staking Rewards Staking rewards appear as ledger entries of type `staking`: ```bash kraken ledgers --type staking --start 1704067200 --end 1735689600 -o json 2>/dev/null ``` ## Cost Basis Workflow 1. Export all trades for the tax year (CSV). 2. Import into tax software (Koinly, CoinTracker, etc.). 3. Verify deposit/withdrawal records match exchange data. 4. Cross-reference staking rewards from ledger entries. 5. Generate tax report. ## Hard Rules - Export data is read-only; no dangerous operations involved. - Verify export completeness by checking trade counts against `trades-history` totals. - Keep exports secure; they contain full trading history. - Futures and spot exports are separate; ensure both are included.

kraken-twap-execution

Execute large orders as time-weighted slices to reduce market impact.

# kraken-twap-execution Use this skill for: - breaking a large order into smaller time-spaced slices - reducing market impact and slippage on size - executing over minutes, hours, or days - tracking average fill price across slices ## Core Concept Time-Weighted Average Price (TWAP) splits a large order into N equal slices executed at regular intervals. The goal is to achieve an average price close to the time-weighted market average, reducing the impact a single large order would have on the book. ## Parameters - **Total volume**: the full amount to buy or sell - **Slices**: number of child orders (e.g., 10) - **Interval**: time between slices (e.g., 60s, 300s) - **Slice volume**: total volume / slices ## Paper TWAP Test ```bash kraken paper init --balance 50000 -o json 2>/dev/null # Simulate 5 slices of 0.01 BTC each, 60s apart kraken paper buy BTCUSD 0.01 -o json 2>/dev/null # wait 60s kraken paper buy BTCUSD 0.01 -o json 2>/dev/null # wait 60s kraken paper buy BTCUSD 0.01 -o json 2>/dev/null # repeat... kraken paper history -o json 2>/dev/null kraken paper status -o json 2>/dev/null ``` ## Live TWAP Loop The agent runs this loop externally (the CLI does not have a built-in scheduler): ```bash TOTAL_VOLUME=0.05 SLICES=5 SLICE_VOL=$(echo "scale=8; $TOTAL_VOLUME / $SLICES" | bc) INTERVAL=60 for i in $(seq 1 $SLICES); do kraken order buy BTCUSD $SLICE_VOL --type market -o json 2>/dev/null [ $i -lt $SLICES ] && sleep $INTERVAL done ``` ## Limit-Order TWAP Variant Use limit orders at the current best bid/ask for potentially better fills: ```bash PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].a[0]') kraken order buy BTCUSD $SLICE_VOL --type limit --price $PRICE -o json 2>/dev/null ``` Check fill status before the next slice. Cancel unfilled orders and adjust: ```bash kraken open-orders -o json 2>/dev/null ``` ## Tracking Average Fill After all slices, compute the volume-weighted average price from trade history: ```bash kraken trades-history --consolidate-taker -o json 2>/dev/null ``` Sum (price * volume) for each fill, divide by total volume filled. ## Rate Limit Awareness The CLI does not pre-throttle requests. If a slice submission hits a rate limit, the error includes a `suggestion` field with tier-specific limits and a `docs_url` pointing to Kraken's documentation. On `rate_limit` error, pause the loop, read the suggestion, and adjust the interval before resuming. A 60-second interval between slices is well within budget for all tiers. For shorter intervals, consult the `kraken-rate-limits` skill for per-tier counter costs and decay rates. ## Hard Rules - Each live slice requires human approval unless operating at autonomy level 4+. - Track cumulative fill volume and stop if total exceeds target (handle partial fills). - On error, pause the loop rather than skipping the slice; resume after recovery. - Log every slice for post-execution analysis.

kraken-ws-streaming

Real-time data streaming via WebSocket for spot and futures.

# kraken-ws-streaming Use this skill for: - streaming live price, trade, and order book data - monitoring authenticated feeds (executions, balances) - futures-specific streaming (fills, positions, balances) - building event-driven agent loops ## Output Format All WebSocket commands emit NDJSON (one JSON object per line) to stdout. Parse line by line: ```bash kraken ws ticker BTC/USD -o json 2>/dev/null | while read -r line; do echo "$line" | jq -r '.data[0].last // empty' done ``` Do not attempt to parse the full stream as a single JSON object. ## Spot Public Streams Ticker (best bid/ask, last price, volume): ```bash kraken ws ticker BTC/USD -o json 2>/dev/null ``` Ticker with BBO trigger (fires only on best-bid/offer changes): ```bash kraken ws ticker BTC/USD --event-trigger bbo -o json 2>/dev/null ``` Trades: ```bash kraken ws trades BTC/USD -o json 2>/dev/null ``` Order book (L2, configurable depth): ```bash kraken ws book BTC/USD --depth 10 -o json 2>/dev/null ``` OHLC candles: ```bash kraken ws ohlc BTC/USD --interval 1 -o json 2>/dev/null ``` Instrument metadata: ```bash kraken ws instrument BTC/USD -o json 2>/dev/null ``` ## Spot Private Streams (Authenticated) Execution updates (fills, order state changes): ```bash kraken ws executions -o json 2>/dev/null ``` Balance updates: ```bash kraken ws balances -o json 2>/dev/null ``` L3 order book: ```bash kraken ws level3 BTC/USD -o json 2>/dev/null ``` ## Futures Streams Futures ticker: ```bash kraken futures ws ticker PF_XBTUSD -o json 2>/dev/null ``` Futures trades: ```bash kraken futures ws trades PF_XBTUSD -o json 2>/dev/null ``` Futures order book: ```bash kraken futures ws book PF_XBTUSD -o json 2>/dev/null ``` ## Futures Private Streams (Authenticated) Fills: ```bash kraken futures ws fills -o json 2>/dev/null ``` Open orders: ```bash kraken futures ws open-orders -o json 2>/dev/null ``` Open positions: ```bash kraken futures ws open-positions -o json 2>/dev/null ``` Balances and margins: ```bash kraken futures ws balances -o json 2>/dev/null ``` Notifications: ```bash kraken futures ws notifications -o json 2>/dev/null ``` Account log: ```bash kraken futures ws account-log -o json 2>/dev/null ``` ## WebSocket Order Mutations (Spot) Place, amend, and cancel orders over WebSocket for lower latency: ```bash kraken ws add-order -o json 2>/dev/null kraken ws amend-order -o json 2>/dev/null kraken ws cancel-order -o json 2>/dev/null kraken ws cancel-all -o json 2>/dev/null kraken ws batch-add -o json 2>/dev/null kraken ws batch-cancel -o json 2>/dev/null ``` Dead man's switch over WebSocket: ```bash kraken ws cancel-after 60 -o json 2>/dev/null ``` ## Agent Loop Pattern A typical event-driven agent reads from a stream and acts on each event: ```bash 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 # Agent logic: compare price to thresholds, trigger actions done ``` For multi-feed agents, run each stream in a background process and merge events. ## Context Efficiency - Use `--depth` to limit order book snapshot size. - Use `--event-trigger bbo` on tickers to reduce noise. - Prefer streaming over high-frequency REST polling. - Close streams when no longer needed; each holds a connection. ## Hard Rules - WebSocket order mutations are flagged as dangerous. Require human approval. - Never treat NDJSON stream output as a single JSON document. - Handle stream disconnects gracefully; the CLI reconnects automatically with paced exponential backoff and reconnect safety budgeting (up to 12 attempts per stream lifecycle).

recipe-basis-trade-entry

Enter a spot-futures basis trade when the premium exceeds a target threshold.

# Basis Trade Entry > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-basis-trading`, `kraken-futures-risk` Enter a delta-neutral basis trade (long spot, short futures) when the basis premium is attractive. > **CAUTION:** Both legs must fill to be market-neutral. A single-leg fill is a directional bet. ## Steps 1. Get spot price: `SPOT=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]')` 2. Get futures price: `FUTURES=$(kraken futures ticker PF_XBTUSD -o json 2>/dev/null | jq -r '.ticker.last')` 3. Calculate basis: `BASIS=$(echo "scale=4; ($FUTURES - $SPOT) / $SPOT * 100" | bc)` 4. If basis < target threshold (e.g., 0.5% annualized), skip 5. Check spot balance for capital: `kraken balance -o json 2>/dev/null` 6. Check futures margin availability: `kraken futures accounts -o json 2>/dev/null` 7. Calculate matched position sizes 8. Execute spot buy (requires human approval): `kraken order buy BTCUSD 0.01 --type limit --price $SPOT -o json 2>/dev/null` 9. Execute futures short: `kraken futures order sell PF_XBTUSD 1 --type limit --price $FUTURES -o json 2>/dev/null` 10. Verify both legs filled: `kraken open-orders -o json 2>/dev/null` + `kraken futures open-orders -o json 2>/dev/null` 11. If one leg unfilled, cancel it to avoid directional exposure

kraken-alert-patterns

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: ```bash PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]') # 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: ```bash 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): ```bash 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: ```bash kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].v[1]' # Agent compares to historical average # Alert if volume > 2x baseline ``` ## Volatility Alert (OHLC-Based) Read recent candles and compute range or standard deviation: ```bash 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: ```bash 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: ```bash kraken ws balances -o json 2>/dev/null # Each line is a balance update event ``` ## Fill Notification Alert on trade executions: ```bash 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: ```bash kraken futures positions -o json 2>/dev/null # Agent checks unrealized P&L against stop-loss threshold ``` Stream futures balance changes: ```bash kraken futures ws balances -o json 2>/dev/null ``` Futures notifications (margin calls, liquidation warnings): ```bash 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: ```bash 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.

kraken-autonomy-levels

Progress from manual trading to full agent autonomy with controlled risk at each level.

# kraken-autonomy-levels Use this skill to help a trader move from hands-on CLI usage to fully autonomous agent trading in safe, incremental steps. ## Level 1: Read-Only Agent The agent reads market data and account state. No API key needed for public data; a query-only key for account data. **Kraken API key permissions:** Query Funds, Query Open Orders & Trades ```bash export KRAKEN_API_KEY="query-only-key" export KRAKEN_API_SECRET="query-only-secret" kraken ticker BTCUSD -o json 2>/dev/null kraken balance -o json 2>/dev/null kraken open-orders -o json 2>/dev/null ``` The agent can inform, alert, and recommend. It cannot place orders, cancel orders, or move funds. ## Level 2: Paper Trading Agent The agent tests strategies against live prices with zero risk. No API key needed. ```bash kraken paper init --balance 10000 -o json 2>/dev/null kraken paper buy BTCUSD 0.01 -o json 2>/dev/null kraken paper status -o json 2>/dev/null kraken paper reset -o json 2>/dev/null ``` Run paper strategies repeatedly. Compare results across parameter changes. Only move to Level 3 after consistent paper performance. ## Level 3: Supervised Trading Agent The agent places real orders, but a human confirms each one. The API key has trading permissions, but the agent validates before executing and waits for human approval. **Kraken API key permissions:** Query Funds, Create & Modify Orders, Cancel/Close Orders ```bash export KRAKEN_API_KEY="trade-key" export KRAKEN_API_SECRET="trade-secret" # Step 1: Agent validates the order (no submission) kraken order buy BTCUSD 0.001 --type limit --price 50000 --validate -o json 2>/dev/null # Step 2: Agent presents the validated order to the human # Step 3: Human approves or rejects # Step 4: Agent executes only after approval kraken order buy BTCUSD 0.001 --type limit --price 50000 -o json 2>/dev/null ``` Safety controls at this level: - Always `--validate` before executing - Always enable the dead man's switch for the session: `kraken order cancel-after 300 -o json` - Check `open-orders` after every trade to verify state ## Level 4: Autonomous Trading Agent The agent trades independently. No human in the loop. The trader trusts the agent and its strategy. **Kraken API key permissions:** Create & Modify Orders, Cancel/Close Orders, Query Funds ```bash export KRAKEN_API_KEY="full-trade-key" export KRAKEN_API_SECRET="full-trade-secret" ``` The agent passes `--yes` to skip confirmation prompts and operates on its own schedule. **Required safeguards at this level:** 1. **Restricted API key.** Never use a key with withdrawal permissions for an autonomous agent. Create a key that can trade but cannot withdraw funds. 2. **Dead man's switch.** Start every session with `cancel-after` so all orders auto-cancel if the agent crashes or disconnects: ```bash kraken order cancel-after 600 -o json 2>/dev/null ``` Refresh periodically. If the agent stops refreshing, all orders cancel. 3. **Position limits in agent code.** The CLI does not enforce position size or frequency limits. Build these in your agent logic: - Maximum order size per trade - Maximum open positions - Maximum trades per hour - Pair allowlist (only trade specific pairs) 4. **Error handling.** Autonomous agents must handle every error category: - `rate_limit`: back off, reduce frequency - `network`: retry with backoff, do not double-submit orders - `auth`: stop trading, alert the trader - `validation`: log and skip, do not retry unchanged 5. **Monitoring.** Run a separate read-only agent (Level 1) that monitors positions and alerts the trader if thresholds are breached. ## Level 5: Autonomous Agent with Fund Management The agent can also move funds (deposits, withdrawals, transfers between wallets). This is the highest trust level. **Kraken API key permissions:** All permissions including Withdraw Funds This level is rare and high-risk. Only appropriate when: - The agent manages a treasury or rebalances across exchanges - The withdrawal addresses are pre-approved and whitelisted in Kraken's account settings - Kraken's withdrawal address lock is enabled (prevents adding new addresses via API) ## Choosing the Right Level | Level | Agent can | Human involvement | Risk | |-------|-----------|-------------------|------| | 1 | Read data | None | Zero | | 2 | Paper trade | None | Zero | | 3 | Trade with approval | Confirms every order | Low | | 4 | Trade autonomously | Monitors, intervenes if needed | Medium | | 5 | Trade and move funds | Monitors | High | ## Progression Rule Move to the next level only after the agent demonstrates consistent behavior at the current level. Paper trading (Level 2) for at least a week before supervised trading (Level 3). Supervised trading for at least a week before autonomous (Level 4).

kraken-basis-trading

Capture the spot-futures price spread with delta-neutral basis trades.

# kraken-basis-trading Use this skill for: - identifying positive basis (futures premium over spot) - entering delta-neutral positions (long spot, short futures) - monitoring basis convergence - closing both legs when basis narrows or contracts expire ## Core Concept When futures trade at a premium to spot (positive basis), you can buy spot and sell futures for the same notional amount. The profit comes from basis convergence as the contract approaches expiry, or from collecting funding on perpetuals. The position is market-neutral: price movement does not affect P&L, only the spread does. ## Basis Calculation ```bash SPOT=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]') FUTURES=$(kraken futures ticker PF_XBTUSD -o json 2>/dev/null | jq -r '.ticker.last') BASIS=$(echo "scale=4; ($FUTURES - $SPOT) / $SPOT * 100" | bc) echo "Basis: ${BASIS}%" ``` A positive basis means futures are more expensive than spot (contango). A negative basis means futures are cheaper (backwardation). ## Entry (Long Spot + Short Futures) 1. Check spot price and futures price. 2. Ensure the basis is attractive (e.g., > 0.5% annualized). 3. Calculate matched position sizes. 4. Execute both legs (requires human approval): ```bash # Long spot kraken order buy BTCUSD 0.01 --type limit --price $SPOT -o json 2>/dev/null # Short futures (matched notional) kraken futures order sell PF_XBTUSD 1 --type limit --price $FUTURES -o json 2>/dev/null ``` ## Monitoring Watch basis convergence: ```bash # Periodic check kraken ticker BTCUSD -o json 2>/dev/null kraken futures ticker PF_XBTUSD -o json 2>/dev/null ``` Check positions: ```bash kraken balance -o json 2>/dev/null kraken futures positions -o json 2>/dev/null ``` ## Exit Close both legs when basis narrows to target: ```bash # Sell spot kraken order sell BTCUSD 0.01 --type market -o json 2>/dev/null # Close futures short kraken futures order buy PF_XBTUSD 1 --reduce-only -o json 2>/dev/null ``` ## Risk Considerations - **Execution risk**: legs may fill at different times. The basis can move between fills. - **Funding risk**: on perpetuals, negative funding rates mean the short pays the long, eating into profit. - **Margin risk**: a sharp spot rally increases margin requirement on the short futures leg. - **Leg risk**: if one leg fails to fill, the position is directional, not neutral. ## Hard Rules - Never enter a basis trade without confirming both legs will execute. - Monitor futures margin continuously; a large spot rally can trigger liquidation on the short. - Close both legs together; leaving one open converts to a directional bet. - Requires human approval for all live entries and exits.

kraken-dca-strategy

Dollar cost averaging with scheduled buys and performance tracking.

# kraken-dca-strategy Use this skill for: - implementing a recurring buy strategy at fixed intervals - tracking average cost basis over time - comparing DCA performance against lump-sum entry - running DCA simulations in paper mode first ## Core Concept Dollar cost averaging buys a fixed dollar amount of an asset at regular intervals regardless of price. This reduces timing risk and smooths entry cost over volatile periods. ## Paper DCA Loop (Test First) Always validate the strategy in paper mode before going live. The `paper buy` command takes base-asset volume, not dollar amount. Calculate volume first: ```bash kraken paper init --balance 10000 --currency USD -o json 2>/dev/null # Calculate BTC volume for a $100 buy at current price PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]') VOLUME=$(echo "scale=8; 100 / $PRICE" | bc) # Simulate weekly buys kraken paper buy BTCUSD $VOLUME -o json 2>/dev/null kraken paper status -o json 2>/dev/null # Repeat buy, check status each iteration kraken paper buy BTCUSD $VOLUME -o json 2>/dev/null kraken paper status -o json 2>/dev/null kraken paper history -o json 2>/dev/null ``` ## Live DCA Single Buy Each interval, the agent executes one market buy for the fixed amount: 1. Check current price: ```bash kraken ticker BTCUSD -o json 2>/dev/null ``` 2. Calculate volume from dollar amount (e.g., $100 at current price): ```bash PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]') VOLUME=$(echo "scale=8; 100 / $PRICE" | bc) ``` 3. Validate the order: ```bash kraken order buy BTCUSD $VOLUME --type market --validate -o json 2>/dev/null ``` 4. Execute (requires human approval): ```bash kraken order buy BTCUSD $VOLUME --type market -o json 2>/dev/null ``` 5. Log the trade for cost basis tracking. ## Cost Basis Tracking After each buy, query trade history to compute running average: ```bash kraken trades-history --consolidate-taker -o json 2>/dev/null ``` The agent should maintain a running total: - Total invested (sum of all dollar amounts) - Total units acquired (sum of all volumes) - Average cost = total invested / total units - Current value = total units * current price - Unrealized P&L = current value - total invested ## Limit-Order DCA Variant Instead of market buys, place limit orders slightly below the current price for better fills: ```bash PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].b[0]') LIMIT=$(echo "scale=2; $PRICE * 0.998" | bc) VOLUME=$(echo "scale=8; 100 / $LIMIT" | bc) kraken order buy BTCUSD $VOLUME --type limit --price $LIMIT -o json 2>/dev/null ``` Check fill status at the next interval. Cancel unfilled orders before placing new ones: ```bash kraken open-orders -o json 2>/dev/null kraken order cancel <UNFILLED_TXID> -o json 2>/dev/null ``` ## Multi-Asset DCA Split a fixed budget across multiple assets (e.g., 60% BTC, 30% ETH, 10% SOL): ```bash # $100 total: $60 BTC, $30 ETH, $10 SOL # Calculate volumes for each, then place orders sequentially ``` ## Scheduling The CLI does not include a built-in scheduler. Agents should use external scheduling (cron, task scheduler, or the agent's own loop timer) to trigger DCA buys at the chosen interval (daily, weekly, bi-weekly, monthly). ## Hard Rules - Never execute live DCA buys without explicit human approval for the strategy and per-trade confirmation (unless operating at autonomy level 4+). - Always paper-test the DCA loop first. - Track cost basis after every buy; do not lose history. - Cancel stale limit orders before placing new ones to avoid duplicate exposure.

kraken-earn-staking

Discover staking strategies, allocate funds, and track earn positions.

# kraken-earn-staking Use this skill for: - browsing available earn/staking strategies - allocating funds to earn products - deallocating (unstaking) funds - monitoring current allocations and status ## Discover Strategies ### Lock types - "bonded": The strategy has bonding and/or unbonding period that lock up funds - "instant": Known as "flexible". The funds are immediately allocated or deallocated without a lock-up period - "flex": Known as "auto-earn". No lock-up period. Funds are available for anything - trading, withdrawal, etc. without having to explicitly deallocate them When communicating to client, use the front-end terminology rather than API terminology (so bonded, flexible and auto-earn). ### Flex - Better known as auto-earn - Funds in eligible wallet (i.e. spot wallet) are implicitly allocated - No lock-up period - Funds cannot be explicitly allocated to or deallocated from a strategy via API — Auto-Earn manages this automatically based on settings - Auto-earn preferences (enable/disable per yield source) can be set in user settings, but not via API - The granularity of control per yield source: staking, opt-in-rewards, base-rewards - `can_allocate` and `can_deallocate` on flex strategy are always false even if user is eligible for the flex strategy ### Examples List all strategies for an asset: ```bash kraken earn strategies --asset ETH -o json 2>/dev/null ``` Filter by lock type: ```bash kraken earn strategies --asset ETH --lock-type instant -o json 2>/dev/null kraken earn strategies --asset DOT --lock-type bonded -o json 2>/dev/null ``` Paginate results: ```bash kraken earn strategies --limit 10 --cursor <CURSOR> --ascending -o json 2>/dev/null ``` Key fields in each strategy: `id`, `asset`, `apr_estimate`, `lock_type`, `min_amount`, `can_allocate`, `can_deallocate`, `yield_source`. ## Allocation Workflow 1. Pick a strategy from the list and note its `id`. 2. Allocate funds (requires human approval): ```bash kraken earn allocate <STRATEGY_ID> 1.5 -o json 2>/dev/null ``` 3. Check allocation status (bonded strategies may have a lock-up period): ```bash kraken earn allocate-status <STRATEGY_ID> -o json 2>/dev/null ``` ## Deallocation Workflow 1. Deallocate (requires human approval): ```bash kraken earn deallocate <STRATEGY_ID> 1.0 -o json 2>/dev/null ``` 2. Check deallocation status: ```bash kraken earn deallocate-status <STRATEGY_ID> -o json 2>/dev/null ``` Bonded strategies may have unbonding periods. The status response indicates whether funds are pending or available. ## View Current Allocations ```bash kraken earn allocations -o json 2>/dev/null ``` Filter out zero balances: ```bash kraken earn allocations --hide-zero-allocations -o json 2>/dev/null ``` Convert to a reference currency for comparison: ```bash kraken earn allocations --converted-asset USD --hide-zero-allocations -o json 2>/dev/null ``` ## Strategy Selection Pattern When helping a user choose a strategy: 1. List strategies for the asset. 2. Compare `apr_estimate`, `lock_type`, and `min_amount`. 3. Present a summary: flexible strategies offer instant access; bonded strategies lock funds for higher yield. 4. Confirm the user's choice before allocating. ## Hard Rules - Allocate and deallocate are flagged as dangerous. Never execute without explicit human approval. - Always show the lock type and any unbonding period before allocation. - For bonded strategies, warn the user that funds will be locked for the stated duration. - Check `can_allocate` and `can_deallocate` fields before attempting operations.

kraken-error-recovery

Handle order failures, network errors, and duplicate submissions safely.

# kraken-error-recovery Use this skill for: - recovering from failed order submissions - preventing duplicate orders after network errors - handling partial fills and stuck states - building resilient agent loops ## Error Categories 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 | Retry with exponential backoff | | `validation` | Invalid request parameters | Fix inputs, do not retry unchanged | | `api` | Exchange-side rejection | Inspect error message, adjust request | ## Duplicate Order Prevention After a network error during order submission, the order may or may not have reached the exchange. Check before resubmitting: ```bash kraken open-orders -o json 2>/dev/null ``` If the order appears in open-orders, do not resubmit. If absent: ```bash 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. ## Client Order ID for Idempotency Use `--cl-ord-id` to tag orders with a unique identifier: ```bash 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: ```bash kraken open-orders --cl-ord-id "dca-2024-01-15-001" -o json 2>/dev/null ``` Cancel by client order ID if needed: ```bash kraken order cancel --cl-ord-id "dca-2024-01-15-001" -o json 2>/dev/null ``` ## Network Error Recovery Pattern ``` 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 ``` ## Rate Limit Recovery 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. ```bash # { "error": "rate_limit", "suggestion": "...", "docs_url": "...", "retryable": true } kraken status -o json 2>/dev/null ``` If status succeeds, the rate limit has cleared. ## Partial Fill Handling Limit orders may partially fill. Check order status: ```bash kraken query-orders <TXID> -o json 2>/dev/null ``` Fields: `vol` (requested volume), `vol_exec` (filled volume), `status` (open, closed, canceled). If partially filled and the remaining volume is needed, amend or place a new order for the remaining amount. ## Stuck Order Resolution An order stuck in `open` state that should have filled or been canceled: 1. Check the order: ```bash kraken query-orders <TXID> -o json 2>/dev/null ``` 2. If still open, cancel: ```bash kraken order cancel <TXID> -o json 2>/dev/null ``` 3. Verify cancellation: ```bash kraken open-orders -o json 2>/dev/null ``` ## Hard Rules - Never blind-retry an order after a network error; always check state first. - Use `--cl-ord-id` for all orders in automated loops. - On auth errors, stop all activity and re-authenticate. - Log every error and recovery action for post-session audit.

kraken-fee-optimization

Minimize trading fees through maker orders, volume tiers, and fee-aware execution.

# kraken-fee-optimization Use this skill for: - understanding maker vs taker fee structures - using post-only orders to guarantee maker rates - tracking 30-day volume for tier progression - choosing fee currency to minimize cost ## Fee Tiers Check current 30-day volume and fee rates: ```bash kraken volume --pair BTCUSD -o json 2>/dev/null ``` The response includes `volume` (30-day USD equivalent) and `fees` / `fees_maker` arrays showing the tier schedule. ## Maker vs Taker - **Taker**: you remove liquidity (market orders, limit orders that fill immediately). Higher fee. - **Maker**: you add liquidity (limit orders that rest on the book). Lower fee, sometimes zero. At starter tier: 0.26% taker, 0.16% maker. The difference compounds over many trades. ## Post-Only Orders Force maker execution by rejecting orders that would immediately fill: ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 --oflags post -o json 2>/dev/null ``` If the order would cross the spread and fill as taker, it is rejected instead. This guarantees maker fees on every fill. ## Fee Currency Selection By default, fees are deducted from the received currency. Override with: ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 --oflags fciq -o json 2>/dev/null ``` | Flag | Fee taken from | |------|---------------| | `fciq` | Quote currency (e.g., USD) | | `fcib` | Base currency (e.g., BTC) | Paying fees in quote currency preserves your base asset balance, useful when accumulating. ## Volume-Based Optimization Higher 30-day volume unlocks lower fees. Track progress: ```bash kraken volume -o json 2>/dev/null ``` If close to the next tier threshold, consolidating trading activity (rather than splitting across exchanges) can push you into a cheaper bracket. ## Futures Fee Schedules ```bash kraken futures feeschedules -o json 2>/dev/null ``` Futures fee volumes: ```bash kraken futures fee-schedule-volumes -o json 2>/dev/null ``` ## Fee-Aware Order Sizing When buying a fixed dollar amount, account for fees in the volume calculation: ```bash # $100 buy at starter taker rate (0.26%) # Effective spend: $100 / 1.0026 = $99.74 worth of BTC # Fee: ~$0.26 ``` For precise accounting, check the fee field in the trade response after execution. ## Batch Orders for Fee Efficiency Batch orders share a single API call, reducing overhead. Use when placing related orders: ```bash kraken order batch orders.json --pair BTCUSD -o json 2>/dev/null ``` ## Hard Rules - Order placement commands are dangerous. Never execute without explicit human approval. - Always `--validate` before submitting live orders. - Post-only orders can be rejected; handle rejection gracefully and retry.

kraken-funding-carry

Earn funding rate payments by positioning on the paying side of perpetuals.

# kraken-funding-carry Use this skill for: - scanning funding rates across perpetual contracts - identifying carry opportunities (collect funding by being on the receiving side) - entering hedged carry positions (spot hedge + futures position) - monitoring ongoing carry yield ## Core Concept Perpetual futures charge periodic funding payments between longs and shorts. When the funding rate is positive, longs pay shorts. When negative, shorts pay longs. A carry strategy positions on the receiving side and hedges with spot to remain market-neutral. ## Scan Funding Rates ```bash kraken futures historical-funding-rates PF_XBTUSD -o json 2>/dev/null kraken futures historical-funding-rates PF_ETHUSD -o json 2>/dev/null ``` Compare rates across contracts to find the highest yield. ## Carry Entry (Positive Funding) When funding is positive (longs pay shorts): 1. Short the perpetual. 2. Buy spot as a hedge. ```bash # Hedge: buy spot kraken order buy BTCUSD 0.01 --type market -o json 2>/dev/null # Carry: short perpetual (collect funding) kraken futures order sell PF_XBTUSD 1 -o json 2>/dev/null ``` ## Carry Entry (Negative Funding) When funding is negative (shorts pay longs): 1. Long the perpetual. 2. Sell spot as a hedge (or skip hedge if already holding). ```bash # Carry: long perpetual (collect funding) kraken futures order buy PF_XBTUSD 1 -o json 2>/dev/null # Hedge: sell spot kraken order sell BTCUSD 0.01 --type market -o json 2>/dev/null ``` ## Yield Calculation Annualized yield = funding_rate * funding_periods_per_year * 100. Kraken funding periods are typically every 4 or 8 hours (varies by contract). Check contract specs: ```bash kraken futures instruments -o json 2>/dev/null ``` ## Monitoring Track funding accrual: ```bash kraken futures accounts -o json 2>/dev/null ``` The `unrealizedFunding` field shows accumulated but unsettled funding. Watch for funding rate flips: ```bash kraken futures historical-funding-rates PF_XBTUSD -o json 2>/dev/null ``` If the rate flips direction, the position switches from collecting to paying. Exit or reverse. ## Exit Close both legs when carry becomes unprofitable: ```bash kraken futures order buy PF_XBTUSD 1 --reduce-only -o json 2>/dev/null kraken order sell BTCUSD 0.01 --type market -o json 2>/dev/null ``` ## Hard Rules - Always hedge carry positions to avoid directional exposure. - Monitor funding rates continuously; a flip turns profit into loss. - Monitor margin on the futures leg; price moves require margin even when hedged. - Requires human approval for all entries and exits.

kraken-funding-ops

Manage deposits, withdrawals, and wallet transfers safely.

# kraken-funding-ops Use this skill for: - checking deposit methods and addresses - tracking deposit and withdrawal status - withdrawing funds to pre-approved addresses - transferring between spot and futures wallets ## Deposit Workflow 1. Find available methods for an asset: ```bash kraken deposit methods BTC -o json 2>/dev/null ``` 2. Get a deposit address: ```bash kraken deposit addresses BTC "Bitcoin" -o json 2>/dev/null ``` 3. Generate a new address (if supported): ```bash kraken deposit addresses BTC "Bitcoin" --new -o json 2>/dev/null ``` 4. Monitor incoming deposits: ```bash kraken deposit status --asset BTC -o json 2>/dev/null ``` Filter by time range: ```bash kraken deposit status --asset BTC --start 1704067200 --end 1706745600 -o json 2>/dev/null ``` Paginate large result sets: ```bash kraken deposit status --asset BTC --limit 25 --cursor <CURSOR> -o json 2>/dev/null ``` ## Withdrawal Workflow 1. Check available methods: ```bash kraken withdrawal methods --asset BTC -o json 2>/dev/null ``` 2. Check pre-approved addresses: ```bash kraken withdrawal addresses --asset BTC --verified true -o json 2>/dev/null ``` 3. Get fee estimate: ```bash kraken withdrawal info BTC "my-btc-address" 0.5 -o json 2>/dev/null ``` 4. Execute withdrawal (requires human approval): ```bash kraken withdraw BTC "my-btc-address" 0.5 -o json 2>/dev/null ``` 5. Track status: ```bash kraken withdrawal status --asset BTC -o json 2>/dev/null ``` Cancel a pending withdrawal: ```bash kraken withdrawal cancel BTC <REFID> -o json 2>/dev/null ``` ## Wallet Transfer Move funds between spot and futures wallets: ```bash kraken wallet-transfer USD 1000 --from <SPOT_IIBAN> --to <FUTURES_IIBAN> -o json 2>/dev/null ``` Futures-specific transfer: ```bash kraken futures transfer 1000 USD -o json 2>/dev/null ``` Check transfer history: ```bash kraken futures transfers -o json 2>/dev/null ``` ## Fee-Aware Withdrawal Pattern Always check fees before withdrawing. Compare the fee to the withdrawal amount: ```bash INFO=$(kraken withdrawal info BTC "my-btc-address" 0.5 -o json 2>/dev/null) # Parse .fee and .limit from the response # Present fee to user before proceeding ``` ## Hard Rules - Withdrawals are flagged as dangerous. Never execute without explicit human approval. - Always verify the withdrawal address matches a pre-approved address in account settings. - Use `--verified true` when listing addresses to confirm approval status. - Check fees before every withdrawal; network fees fluctuate. - Cancel pending withdrawals promptly if the user changes their mind: the window is short.

recipe-daily-pnl-report

Generate a daily profit and loss summary from trades and balances.

# Daily P&L Report > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-portfolio-intel` Generate a daily summary of trading activity, fees, and portfolio change. ## Steps 1. Compute today's midnight timestamp: `TS=$(date -j -f '%Y-%m-%d' "$(date +%Y-%m-%d)" +%s 2>/dev/null || date -d 'today 00:00' +%s)` 2. Get current balances: `kraken balance -o json 2>/dev/null` 3. Get current prices: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 4. Calculate total portfolio value in USD 5. Get today's trades: `kraken trades-history --consolidate-taker -o json 2>/dev/null` 6. Get today's ledger entries: `kraken ledgers --start $TS -o json 2>/dev/null` 7. Calculate realized P&L from closed trades 8. Calculate fees paid today (sum of fee fields from trades) 9. Check futures positions if applicable: `kraken futures positions -o json 2>/dev/null` 10. Check futures funding accrued: `kraken futures accounts -o json 2>/dev/null` 11. Present summary: total value, daily change, realized P&L, fees, open positions

recipe-drawdown-circuit-breaker

Automatically stop trading when portfolio drawdown exceeds a threshold.

# Drawdown Circuit Breaker > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-risk-operations`, `kraken-alert-patterns` Monitor portfolio value and halt trading if cumulative drawdown from peak exceeds a limit (e.g., 10%). ## Steps 1. Record starting portfolio value: `kraken balance -o json 2>/dev/null` + `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` (calculate total USD value) 2. Set this as the high-water mark 3. On each check interval (at least 5 seconds; see `kraken-rate-limits` for tier budgets): - Recalculate total portfolio value - Update high-water mark if value exceeds previous peak - Calculate drawdown: (peak - current) / peak * 100 4. If drawdown exceeds threshold (e.g., 10%): - Alert the user immediately - Cancel all open orders: `kraken order cancel-all -o json 2>/dev/null` - Cancel all futures orders: `kraken futures cancel-all -o json 2>/dev/null` 5. Present drawdown report: peak value, current value, drawdown percentage, orders cancelled 6. Cancel operations require explicit human approval unless operating at autonomy level 4+ 7. Wait for explicit user instruction before resuming any trading activity

kraken-futures-risk

Futures-specific risk management: leverage, funding rates, margin, and liquidation awareness.

# kraken-futures-risk Use this skill for: - checking and setting leverage - monitoring funding rates for carry cost - tracking margin and account health - position sizing relative to available margin - understanding liquidation risk ## Leverage Management Check current leverage preferences: ```bash kraken futures leverage -o json 2>/dev/null ``` Check leverage for a specific symbol: ```bash kraken futures leverage --symbol PF_XBTUSD -o json 2>/dev/null ``` Set maximum leverage (requires human approval): ```bash kraken futures set-leverage PF_XBTUSD 5 -o json 2>/dev/null ``` Lower leverage reduces liquidation risk but requires more margin per position. ## Funding Rate Monitoring Check historical funding rates: ```bash kraken futures historical-funding-rates PF_XBTUSD -o json 2>/dev/null ``` Funding rates are periodic payments between longs and shorts. Positive rates mean longs pay shorts; negative rates mean shorts pay longs. High sustained rates increase carry cost for directional positions. Use funding rates to: - Estimate holding cost for a position over time. - Identify crowded trades (extreme funding rates). - Time entries when funding flips direction. ## Account and Margin Health Check account balances and margin: ```bash kraken futures accounts -o json 2>/dev/null ``` Key fields: `availableFunds`, `initialMargin`, `maintenanceMargin`, `unrealizedFunding`, `pnl`. Margin ratio = maintenanceMargin / equity. When this approaches 1.0, liquidation risk is high. ## Position Monitoring View all open positions: ```bash kraken futures positions -o json 2>/dev/null ``` Stream position updates in real time: ```bash kraken futures ws open-positions -o json 2>/dev/null ``` Monitor P&L and size continuously. Set agent-side thresholds for: - Maximum unrealized loss per position - Maximum total portfolio loss - Maximum position size ## PnL Preferences Check P&L calculation method: ```bash kraken futures pnl-preferences -o json 2>/dev/null ``` Set preference for a specific symbol: ```bash kraken futures set-pnl-preference PF_XBTUSD FIFO -o json 2>/dev/null ``` ## Unwind Queue Check if any positions are in the unwind queue (approaching liquidation): ```bash kraken futures unwind-queue -o json 2>/dev/null ``` If positions appear here, the agent should alert immediately and consider reducing exposure. ## Pre-Trade Risk Check Before placing a futures order, always: 1. Check available margin: ```bash kraken futures accounts -o json 2>/dev/null ``` 2. Check current positions: ```bash kraken futures positions -o json 2>/dev/null ``` 3. Check current leverage: ```bash kraken futures leverage --symbol PF_XBTUSD -o json 2>/dev/null ``` 4. Estimate position margin requirement based on order size and leverage. 5. Confirm available funds exceed the required margin with a safety buffer. ## Emergency Procedures Close all positions: ```bash kraken futures cancel-all -o json 2>/dev/null # Then close each position with a reduce-only market order kraken futures order sell PF_XBTUSD <POSITION_SIZE> --reduce-only -o json 2>/dev/null ``` Dead man's switch: ```bash kraken futures cancel-after 300 -o json 2>/dev/null ``` ## Hard Rules - Never increase leverage without explicit human approval. - Monitor margin ratio continuously during live sessions. - Alert when margin ratio exceeds 0.7 (conservative threshold). - Alert when unrealized loss exceeds a pre-defined stop-loss level. - Check funding rates before opening new positions to understand carry cost. - Use `--reduce-only` when closing positions to prevent accidental reversals.

kraken-futures-trading

Place, manage, and monitor futures orders across the full lifecycle.

# kraken-futures-trading Use this skill for: - placing futures buy and sell orders (market, limit, post, stop, take-profit, ioc, trailing-stop, fok) - editing and cancelling futures orders - batch order placement for multi-leg strategies - monitoring open positions and fills ## Authentication Futures use separate credentials from spot: ```bash export KRAKEN_FUTURES_API_KEY="your-futures-key" export KRAKEN_FUTURES_API_SECRET="your-futures-secret" ``` ## Safe Execution Flow 1. Check available contracts: ```bash kraken futures instruments -o json 2>/dev/null ``` 2. Read current price: ```bash kraken futures ticker PF_XBTUSD -o json 2>/dev/null ``` 3. Check account state: ```bash kraken futures accounts -o json 2>/dev/null ``` 4. Place order (requires human approval): ```bash kraken futures order buy PF_XBTUSD 1 --type limit --price 50000 -o json 2>/dev/null ``` 5. Verify placement: ```bash kraken futures open-orders -o json 2>/dev/null ``` ## Order Types Market order: ```bash kraken futures order buy PF_XBTUSD 1 --type market -o json 2>/dev/null ``` Limit order: ```bash kraken futures order sell PF_XBTUSD 1 --type limit --price 70000 -o json 2>/dev/null ``` Stop order: ```bash kraken futures order buy PF_XBTUSD 1 --type stop --stop-price 55000 --trigger-signal mark -o json 2>/dev/null ``` Trailing stop: ```bash kraken futures order sell PF_XBTUSD 1 --type trailing-stop --stop-price 68000 --trailing-stop-max-deviation 500 --trailing-stop-deviation-unit quote_currency -o json 2>/dev/null ``` Reduce-only (close position without opening new exposure): ```bash kraken futures order sell PF_XBTUSD 1 --type market --reduce-only -o json 2>/dev/null ``` ## Batch Orders Place multiple orders atomically (useful for bracket entries): ```bash kraken futures batch-order '[ {"order":"sendorder","orderTag":"entry","symbol":"PF_XBTUSD","side":"buy","size":1,"orderType":"lmt","limitPrice":50000}, {"order":"sendorder","orderTag":"tp","symbol":"PF_XBTUSD","side":"sell","size":1,"orderType":"lmt","limitPrice":55000,"reduceOnly":true} ]' -o json 2>/dev/null ``` ## Edit and Cancel Edit in place: ```bash kraken futures edit-order --order-id <ID> --price 51000 -o json 2>/dev/null ``` Cancel one: ```bash kraken futures cancel --order-id <ID> -o json 2>/dev/null ``` Cancel all: ```bash kraken futures cancel-all -o json 2>/dev/null ``` Cancel by symbol: ```bash kraken futures cancel-all --symbol PF_XBTUSD -o json 2>/dev/null ``` ## Position Monitoring Open positions: ```bash kraken futures positions -o json 2>/dev/null ``` Recent fills: ```bash kraken futures fills --since 2024-01-01T00:00:00Z -o json 2>/dev/null ``` Execution history: ```bash kraken futures history-executions --since 2024-01-01T00:00:00Z --sort desc -o json 2>/dev/null ``` Order history: ```bash kraken futures history-orders --sort desc -o json 2>/dev/null ``` ## Dead Man's Switch Enable for unattended sessions. All orders cancel if the timer expires: ```bash kraken futures cancel-after 600 -o json 2>/dev/null ``` Refresh periodically. If the agent crashes, orders auto-cancel. ## Paper Trading Test futures strategies without real money using `kraken futures paper`. Near-parity with live futures: all 8 order types (market, limit, post, stop, take-profit, ioc, trailing-stop, fok); leverage, margin tracking, liquidation simulation, and funding rates. Known differences: single-ID `order-status`, post-only orders are cancelled rather than queued, fills use the bid/ask snapshot with no depth-based slippage, and partial fills are not modeled. ```bash kraken futures paper init --balance 10000 -o json 2>/dev/null kraken futures paper buy PF_XBTUSD 1 --leverage 10 --type market -o json 2>/dev/null kraken futures paper positions -o json 2>/dev/null kraken futures paper status -o json 2>/dev/null kraken futures paper reset -o json 2>/dev/null ``` Switch between paper and live by replacing `futures paper` with `futures order`. No credentials required for paper trading. ## Hard Rules - Never place futures orders without explicit human approval. - Always check `futures accounts` before trading to confirm margin availability. - Use `--reduce-only` when closing positions to prevent accidental flips. - Enable `cancel-after` for any automated session. - Test strategies with `kraken futures paper` before going live.

recipe-earn-yield-compare

Compare earn strategy yields across assets and lock types to find the best rate.

# Compare Earn Yields > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-earn-staking` Compare available staking/earn strategies across assets to find the best risk-adjusted yield. ## Steps 1. List strategies for multiple assets: - `kraken earn strategies --asset ETH -o json 2>/dev/null` - `kraken earn strategies --asset DOT -o json 2>/dev/null` - `kraken earn strategies --asset SOL -o json 2>/dev/null` - `kraken earn strategies --asset ATOM -o json 2>/dev/null` 2. Extract `apr_estimate`, `lock_type`, `min_amount`, `can_allocate` from each 3. Separate by lock type: flexible vs bonded 4. Rank by APR within each lock type 5. Present comparison table: asset, APR, lock type, minimum amount, availability 6. Check current allocations: `kraken earn allocations --hide-zero-allocations --converted-asset USD -o json 2>/dev/null` 7. Identify reallocation opportunities (move from lower to higher yield) 8. If user approves, deallocate from lower yield and allocate to higher yield

recipe-portfolio-snapshot-csv

Export a portfolio snapshot with balances and valuations to CSV.

# Portfolio Snapshot to CSV > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-portfolio-intel` Capture a point-in-time portfolio snapshot combining balances, prices, and earn allocations. ## Steps 1. Get all balances: `kraken balance -o json 2>/dev/null` 2. Identify held assets (non-zero balances) 3. Get prices for all held assets: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 4. Get earn allocations: `kraken earn allocations --hide-zero-allocations --converted-asset USD -o json 2>/dev/null` 5. Calculate USD value per asset 6. Check futures positions: `kraken futures positions -o json 2>/dev/null` 7. Format as CSV: `asset, balance, price_usd, value_usd, earn_allocated, total_exposure` 8. Output to stdout or write to file 9. Include timestamp and total portfolio value as header row

kraken-grid-trading

Grid trading strategy with layered buy and sell orders across a price range.

# kraken-grid-trading Use this skill for: - placing a grid of limit orders across a price range - profiting from sideways/ranging markets - managing grid state (filled orders, replacements) - paper-testing grid parameters before live deployment ## Core Concept Grid trading places buy orders below the current price and sell orders above it at fixed intervals. When a buy fills, a corresponding sell is placed one grid level higher. When a sell fills, a corresponding buy is placed one grid level lower. Profit comes from capturing the spread at each level. ## Grid Parameters Define before starting: - **Pair**: e.g., BTCUSD - **Range**: lower bound to upper bound (e.g., 55000-65000) - **Grid levels**: number of orders (e.g., 10) - **Order size**: volume per grid level (e.g., 0.001 BTC) Grid spacing = (upper - lower) / grid levels. ## Paper Grid Test Always test in paper mode first: ```bash kraken paper init --balance 10000 -o json 2>/dev/null # Place buy grid below current price kraken paper buy BTCUSD 0.001 --type limit --price 58000 -o json 2>/dev/null kraken paper buy BTCUSD 0.001 --type limit --price 57000 -o json 2>/dev/null kraken paper buy BTCUSD 0.001 --type limit --price 56000 -o json 2>/dev/null # Place sell grid above current price kraken paper sell BTCUSD 0.001 --type limit --price 62000 -o json 2>/dev/null kraken paper sell BTCUSD 0.001 --type limit --price 63000 -o json 2>/dev/null kraken paper sell BTCUSD 0.001 --type limit --price 64000 -o json 2>/dev/null kraken paper orders -o json 2>/dev/null kraken paper status -o json 2>/dev/null ``` ## Live Grid Placement 1. Read current price to center the grid: ```bash kraken ticker BTCUSD -o json 2>/dev/null ``` 2. Calculate grid levels (agent logic). 3. Validate each order: ```bash kraken order buy BTCUSD 0.001 --type limit --price 58000 --validate -o json 2>/dev/null ``` 4. Place orders (requires human approval for the full grid): ```bash kraken order buy BTCUSD 0.001 --type limit --price 58000 -o json 2>/dev/null kraken order buy BTCUSD 0.001 --type limit --price 57000 -o json 2>/dev/null # ... remaining grid levels ``` 5. Use batch orders when placing 2-15 orders: ```bash kraken order batch grid-orders.json --pair BTCUSD --validate -o json 2>/dev/null kraken order batch grid-orders.json --pair BTCUSD -o json 2>/dev/null ``` ## Grid Maintenance Loop Monitor fills and replace completed orders: 1. Check open orders: ```bash kraken open-orders -o json 2>/dev/null ``` 2. Check recent trades for fills: ```bash kraken trades-history -o json 2>/dev/null ``` 3. For each filled buy at level N, place a sell at level N+1. 4. For each filled sell at level N, place a buy at level N-1. Stream executions for real-time fill detection: ```bash kraken ws executions -o json 2>/dev/null ``` ## Grid Shutdown Cancel all grid orders cleanly: ```bash kraken order cancel-all -o json 2>/dev/null ``` Or cancel specific orders by TXID: ```bash kraken order cancel-batch <TXID1> <TXID2> <TXID3> -o json 2>/dev/null ``` ## Risk Considerations - Grid trading profits in ranging markets but loses in strong trends. - If price moves below the entire grid, the agent accumulates the asset at a loss. - If price moves above the entire grid, the agent sells all holdings and misses further upside. - Set stop-loss boundaries outside the grid range to limit downside. ## Hard Rules - Never place a live grid without explicit human approval. - Paper-test every grid configuration before live deployment. - Enable `cancel-after` for unattended grid sessions. - Track total grid P&L, not just individual level fills. - Cancel the entire grid before adjusting parameters; do not leave orphaned orders.

kraken-liquidation-guard

Prevent futures liquidation through margin monitoring and emergency procedures.

# kraken-liquidation-guard Use this skill for: - monitoring margin ratio to detect liquidation risk - automated position reduction when thresholds are breached - emergency flatten procedures - proactive margin top-up patterns ## Margin Health Check ```bash kraken futures accounts -o json 2>/dev/null ``` Key fields: - `equity`: total account value - `initialMargin`: margin held for positions - `maintenanceMargin`: minimum margin before liquidation - `availableFunds`: free margin for new positions Margin ratio = maintenanceMargin / equity. Liquidation approaches as this ratio nears 1.0. ## Alert Thresholds | 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 | ## Monitoring Loop ```bash kraken futures ws balances -o json 2>/dev/null | while read -r line; do # Parse equity and maintenanceMargin # Calculate ratio # Alert or act when threshold is breached done ``` Or poll periodically: ```bash kraken futures accounts -o json 2>/dev/null ``` ## Unwind Queue Check If a position enters the unwind queue, liquidation is imminent: ```bash kraken futures unwind-queue -o json 2>/dev/null ``` Any result here requires immediate action. ## Emergency Flatten Cancel all open orders, then close all positions: ```bash # 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> --reduce-only -o json 2>/dev/null ``` ## Margin Top-Up Transfer funds from spot wallet to futures to increase margin: ```bash kraken futures transfer 5000 USD -o json 2>/dev/null ``` Or from main account: ```bash kraken wallet-transfer USD 5000 --from <SPOT_IIBAN> --to <FUTURES_IIBAN> -o json 2>/dev/null ``` ## Leverage Reduction Lower leverage to reduce margin requirements: ```bash kraken futures set-leverage PF_XBTUSD 2 -o json 2>/dev/null ``` ## Dead Man's Switch Always run a dead man's switch during futures sessions: ```bash kraken futures cancel-after 600 -o json 2>/dev/null ``` If the agent crashes, orders auto-cancel, preventing further margin consumption. ## Hard Rules - Monitor margin ratio continuously during any futures session. - Alert at 0.5 ratio; act at 0.7. Do not wait for the exchange to liquidate. - Emergency flatten requires human approval unless the agent operates at autonomy level 4+. - Never increase position size when margin ratio is above 0.3.

kraken-market-intel

Read market state with low-noise data pulls and streaming updates.

# kraken-market-intel Use this skill to answer questions like: - "What is the current BTCUSD price?" - "Is spread widening?" - "What is short-term trend from candles?" ## Snapshot Pattern ```bash kraken ticker BTCUSD -o json 2>/dev/null kraken orderbook BTCUSD --count 10 -o json 2>/dev/null kraken ohlc BTCUSD --interval 60 -o json 2>/dev/null ``` ## Streaming Pattern ```bash kraken ws ticker BTC/USD -o json 2>/dev/null ``` Parse NDJSON line by line. Do not treat stream output as one JSON object. ## Context Efficiency - Prefer one pair at a time unless comparison is needed. - Use `--count` and `--depth` flags to limit payload size. - Prefer streaming over high-frequency polling. ## Typical Output Use - Ticker: last price, bid, ask - Orderbook: near-book depth and imbalance - OHLC: trend and volatility windows

kraken-mcp-integration

Connect MCP clients to kraken-cli for native tool calling without subprocess wrappers.

# kraken-mcp-integration Use this skill to connect any MCP-compatible client to `kraken-cli` for structured tool calling over stdio. MCP tool calls execute through the same command path as CLI commands, so error handling and rate-limit behavior is identical between MCP and CLI. ## Supported Clients Claude Desktop, ChatGPT, Codex, Gemini CLI, Cursor, VS Code, Windsurf, and any client that supports the MCP `mcpServers` configuration block. ## Setup ### 1. Configure your MCP client Add this to your MCP client configuration (Claude Desktop: `claude_desktop_config.json`, Cursor: `.cursor/mcp.json`, etc.): ```json { "mcpServers": { "kraken": { "command": "kraken", "args": ["mcp", "-s", "market,paper"] } } } ``` `-s market,paper` is the default service list: public market data plus paper trading. No real funds can be touched until you opt in explicitly by expanding the service list. See [Enabling live trading](#enabling-live-trading) below. Credential resolution follows the standard CLI precedence: command-line flags, then `KRAKEN_API_KEY` / `KRAKEN_API_SECRET` in the MCP server's `env` block, then a secure local config file managed by the CLI (written by `kraken auth set` and `kraken setup`, stored with user-only permissions in your OS's standard config directory). The MCP server and the standalone CLI share the same config file, so a single `kraken auth set` serves both. ### 2. Set credentials (only needed for live trading) If you stay on `market,paper`, skip this step — paper trading needs no keys. For live trading, the MCP server reads credentials from environment variables: ```bash export KRAKEN_API_KEY="your-key" export KRAKEN_API_SECRET="your-secret" ``` ### 3. Restart your MCP client The client discovers tools on startup. ## Service Filtering Control which command groups the MCP server exposes: ```bash kraken mcp -s market # public data only (safe, no auth) kraken mcp -s market,paper # market data + paper trading (marketplace default) kraken mcp -s market,trade,paper # add live trading kraken mcp -s market,account,trade # add account queries and live trading kraken mcp -s all # everything (many tools, includes funding/earn/subaccount) ``` Keep the service list to what you need. MCP clients typically handle 50-100 tools well. | Service | Auth | Tools | Risk | |---------|------|-------|------| | market | No | ~10 | None | | account | Yes | ~18 | Read-only | | trade | Yes | ~9 | Orders (dangerous) | | funding | Yes | ~10 | Withdrawals (dangerous) | | earn | Yes | ~6 | Staking (dangerous) | | subaccount | Yes | ~2 | Transfers (dangerous) | | futures | Mixed | ~39 | Orders (dangerous) | | paper | No | ~10 | None (simulation) | | auth | No | ~3 | Read-only (auth set/auth reset excluded) | ## Enabling live trading Every `kraken-cli` marketplace listing ships with `-s market,paper` by default, so a fresh install can never place a real order. To opt in to live trading, edit the MCP server args in your client's config and widen the service list: ```json { "mcpServers": { "kraken": { "command": "kraken", "args": ["mcp", "-s", "market,trade,paper"], "env": { "KRAKEN_API_KEY": "your-key", "KRAKEN_API_SECRET": "your-secret" } } } } ``` Recommended upgrade path: 1. Start with `market,paper` (the default). 2. Add `trade` once you are comfortable and have an API key scoped to orders only. See the "Recommended key scope" section of `skills/kraken-setup/SKILL.md` before generating a key. 3. Add `account` if you want the agent to read balances and positions. 4. Only enable `funding`, `earn`, `subaccount`, or `all` if you specifically need those workflows. Each of these unlocks tools that can move funds off the exchange or alter account structure. Switching to `-s all` expands the set of tools the agent can reach by prompt-injection or mistake. Prefer a narrow list and widen it deliberately. ## Safety Dangerous tools include `[DANGEROUS: requires human confirmation]` in their description and carry the MCP `destructive_hint` annotation. In guarded mode (default), calls must include `acknowledged=true`. In autonomous mode (`--allow-dangerous`), the per-call confirmation is disabled. MCP clients that respect annotations may still prompt at the client layer. For fully autonomous operation, see `skills/kraken-autonomy-levels/SKILL.md`. ## Gemini CLI Extension If using Gemini CLI, install the extension directly: ```bash gemini extensions install https://github.com/krakenfx/kraken-cli ``` The `gemini-extension.json` includes `mcpServers` config, so the MCP server starts automatically. ## Troubleshooting **"No tools found"**: Check that `kraken` is on your PATH and the service list is valid. Run `kraken mcp -s market` manually to verify it starts. **Auth errors on tool calls**: Set `KRAKEN_API_KEY` and `KRAKEN_API_SECRET` in the environment where your MCP client runs. **Too many tools**: Reduce the service list. `kraken mcp -s market,trade` is a good starting point. **Streaming commands not available**: WebSocket streaming commands are excluded from MCP v1. Use `kraken ws ...` directly from the terminal for streaming.

recipe-price-level-alerts

Set up price level alerts that notify when key levels are crossed.

# Price Level Alerts > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-alert-patterns` Define upper and lower price levels for a pair and get notified when they are crossed. ## Steps 1. Get current price for reference: `kraken ticker BTCUSD -o json 2>/dev/null` 2. Define alert levels: - Upper: e.g., 70000 (breakout) - Lower: e.g., 55000 (breakdown) 3. Start streaming: `kraken ws ticker BTC/USD --event-trigger bbo -o json 2>/dev/null` 4. Parse each line: extract last price 5. Compare against upper level: if price >= upper, alert "BTCUSD broke above 70000" 6. Compare against lower level: if price <= lower, alert "BTCUSD broke below 55000" 7. After alert fires, optionally stop monitoring or set new levels 8. Agent delivers alert through its notification channel (chat, Slack, etc.)

kraken-multi-pair

Monitor multiple trading pairs simultaneously for screening and comparison.

# kraken-multi-pair Use this skill for: - screening multiple pairs at once (price, spread, volume) - comparing relative performance across assets - building watchlists for agent-driven monitoring - identifying opportunity across a pair universe ## Multi-Pair Ticker Snapshot Pass multiple pairs to a single ticker call: ```bash kraken ticker BTCUSD ETHUSD SOLUSD DOTUSD -o json 2>/dev/null ``` The response contains one object per pair. Extract and compare: ```bash kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null | jq 'to_entries[] | {pair: .key, last: .value.c[0], volume: .value.v[1]}' ``` ## Multi-Pair Streaming Stream tickers for several pairs simultaneously: ```bash kraken ws ticker BTC/USD ETH/USD SOL/USD -o json 2>/dev/null ``` Each NDJSON line includes a pair identifier. Route updates by pair in the agent loop: ```bash 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') [ -n "$PAIR" ] && echo "$PAIR: $LAST" done ``` ## Pair Discovery List all tradable pairs: ```bash kraken pairs -o json 2>/dev/null ``` Filter to USD-quoted pairs for a consistent base: ```bash kraken pairs -o json 2>/dev/null | jq '[to_entries[] | select(.key | endswith("USD")) | .key]' ``` ## Spread Comparison Compare bid-ask spreads across pairs to gauge liquidity: ```bash kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null | jq 'to_entries[] | {pair: .key, spread: ((.value.a[0] | tonumber) - (.value.b[0] | tonumber))}' ``` ## Volume Screening Identify high-volume pairs from a watchlist: ```bash kraken ticker BTCUSD ETHUSD SOLUSD ADAUSD DOTUSD -o json 2>/dev/null | jq 'to_entries | sort_by(-(.value.v[1] | tonumber)) | .[] | {pair: .key, vol_24h: .value.v[1]}' ``` ## Futures Multi-Symbol Monitor multiple futures contracts: ```bash kraken futures tickers -o json 2>/dev/null ``` Stream multiple futures tickers: ```bash kraken futures ws ticker PF_XBTUSD PF_ETHUSD -o json 2>/dev/null ``` ## Watchlist Pattern Define a watchlist as a space-separated string and reuse across commands: ```bash WATCHLIST="BTCUSD ETHUSD SOLUSD ADAUSD DOTUSD" kraken ticker $WATCHLIST -o json 2>/dev/null kraken ws ticker $WATCHLIST -o json 2>/dev/null ``` ## Context Efficiency - Batch pairs into a single command instead of one call per pair. - Use streaming for continuous monitoring; use REST snapshots for periodic checks. - Limit watchlist size to reduce context window consumption when passing results to an agent.

kraken-order-types

Complete reference for all spot and futures order types and modifiers.

# kraken-order-types Use this skill for: - choosing the right order type for a given scenario - understanding order modifiers (post-only, reduce-only, GTC, IOC, FOK) - constructing complex orders with stop-loss and take-profit - batch and conditional order patterns ## Spot Order Types ### Market Fills immediately at best available price. Simple, guaranteed fill, but no price control. ```bash kraken order buy BTCUSD 0.001 -o json 2>/dev/null kraken order sell BTCUSD 0.001 --type market -o json 2>/dev/null ``` ### Limit Fills at the specified price or better. No fill guarantee if price never reaches the level. ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 -o json 2>/dev/null ``` ### Stop-Loss Triggers a market order when the price crosses the stop level. ```bash kraken order sell BTCUSD 0.001 --type stop-loss --price 48000 -o json 2>/dev/null ``` ### Stop-Loss Limit Triggers a limit order when the price crosses the stop level. ```bash kraken order sell BTCUSD 0.001 --type stop-loss-limit --price 48000 --price2 47500 -o json 2>/dev/null ``` ### Take-Profit Triggers a market order when the price reaches the profit target. ```bash kraken order sell BTCUSD 0.001 --type take-profit --price 55000 -o json 2>/dev/null ``` ### Take-Profit Limit Triggers a limit order at the profit target. ```bash kraken order sell BTCUSD 0.001 --type take-profit-limit --price 55000 --price2 54800 -o json 2>/dev/null ``` ### Trailing Stop Stop level moves with the market to lock in profits. ```bash kraken order sell BTCUSD 0.001 --type trailing-stop --price +500 -o json 2>/dev/null ``` ### Trailing Stop Limit Trailing stop that triggers a limit order instead of market. ```bash kraken order sell BTCUSD 0.001 --type trailing-stop-limit --price +500 --price2 -100 -o json 2>/dev/null ``` ## Spot Order Modifiers | Flag | Effect | |------|--------| | `--oflags post` | Post-only: reject if it would immediately fill (maker only) | | `--oflags fciq` | Fee in quote currency | | `--oflags fcib` | Fee in base currency | | `--oflags nompp` | No market price protection | | `--timeinforce GTC` | Good-til-cancelled (default) | | `--timeinforce IOC` | Immediate-or-cancel: fill what you can, cancel the rest | | `--timeinforce GTD` | Good-til-date: cancel after specified expiry | | `--validate` | Validate only, do not submit | ## Futures Order Types ### Market ```bash kraken futures order buy PF_XBTUSD 1 -o json 2>/dev/null ``` ### Limit ```bash kraken futures order buy PF_XBTUSD 1 --type limit --price 50000 -o json 2>/dev/null ``` ### Stop ```bash kraken futures order sell PF_XBTUSD 1 --type stop --stop-price 48000 --trigger-signal mark -o json 2>/dev/null ``` ### Trailing Stop (Futures) ```bash kraken futures order sell PF_XBTUSD 1 --type stop --stop-price 68000 --trailing-stop-max-deviation 500 --trailing-stop-deviation-unit quote_currency -o json 2>/dev/null ``` ## Futures Order Modifiers | Flag | Effect | |------|--------| | `--reduce-only` | Close existing position only, never open new | | `--trigger-signal mark` | Trigger on mark price | | `--trigger-signal index` | Trigger on index price | | `--trigger-signal last` | Trigger on last traded price | | `--client-order-id <ID>` | Attach a custom ID for tracking | ## Order Selection Guide | Goal | Order Type | |------|-----------| | Buy now at any price | market | | Buy at a specific price or better | limit | | Protect downside if price drops | stop-loss | | Lock in profit if price rises | take-profit | | Trail a rising price and sell on reversal | trailing-stop | | Earn maker rebates | limit + `--oflags post` | | Fill immediately or not at all | limit + `--timeinforce IOC` | ## Validation Always validate before submitting: ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 --validate -o json 2>/dev/null ``` ## Hard Rules - All order placement commands are dangerous. Never execute without explicit human approval. - Always validate with `--validate` before live submission. - Use `--reduce-only` on futures exits to prevent accidental position flips.

kraken-paper-strategy

Test strategy logic on paper trading before touching live funds.

# kraken-paper-strategy Use this skill for: - validating entry and exit logic on spot markets - testing position sizing and simple rebalance loops - rehearsing error handling without risk For futures paper trading (leverage, margin, shorts, liquidation), see `kraken futures paper` commands. This skill covers spot paper trading only. ## Limitations Paper trading runs locally against live market prices. A 0.26% taker fee (Kraken Starter tier default) is applied to every fill, but slippage and partial fills are not modeled. - **Fees included.** A 0.26% taker fee is deducted from collateral on each fill. Live maker fees are lower (0.16%), so limit orders that provide liquidity on a live exchange cost less than paper predicts. - **No slippage.** Paper orders fill at the exact quoted price. Live market orders can fill at worse prices, especially for larger sizes or thin order books. - **No partial fills or rejection.** Paper orders always fill in full immediately. Live orders may partially fill, queue, or be rejected. When presenting paper results to the user, note that slippage is not modeled and live performance will differ. The fee deduction is already reflected in paper P&L. ## Baseline Workflow ```bash kraken paper init --balance 10000 --currency USD -o json 2>/dev/null kraken paper buy BTCUSD 0.01 -o json 2>/dev/null kraken paper status -o json 2>/dev/null kraken paper sell BTCUSD 0.005 --type limit --price 70000 -o json 2>/dev/null kraken paper orders -o json 2>/dev/null kraken paper history -o json 2>/dev/null ``` ## Reset Between Runs ```bash kraken paper reset -o json 2>/dev/null ``` ## Migration Rule Only move a strategy to live trading after: 1. repeated paper runs with stable behavior 2. explicit user sign-off 3. `--validate` checks pass for live order payloads

kraken-paper-to-live

Promote a validated paper strategy to live trading with safety checks.

# kraken-paper-to-live Use this skill for: - validating a strategy has stable paper results before going live - running pre-flight checks before first live trade - migrating paper commands to their live equivalents - establishing safety controls for the live session ## Paper-to-Live Performance Gap Both spot and futures paper trading simulate taker fees (0.26% spot, configurable for futures). Slippage and partial fills are not fully modeled. Live results may differ. Before promoting, factor in: - **Slippage:** Market orders fill at available liquidity, not the mid-price. Thin books or larger sizes widen the gap. - **Partial fills and latency:** Limit orders may fill partially or not at all. Network and matching-engine latency can cause missed entries or exits. - **Maker fees:** Paper uses taker fee rates for all fills. Live limit orders that provide liquidity pay lower maker fees (0.16% spot). When presenting promotion analysis to the user, explicitly state the expected performance reduction from these factors. ## Promotion Criteria A strategy is ready for live promotion when: 1. Paper runs produce consistent results over multiple sessions. 2. Error handling works correctly (rate limits, network failures). 3. The strategy stays within defined risk parameters. 4. Paper returns remain positive after subtracting estimated fees (0.26% per fill for spot, 0.05% for futures). 5. The user explicitly approves the transition. ## Pre-Flight Checklist ### Spot Before the first live spot trade: 1. **Verify credentials**: ```bash kraken auth test -o json 2>/dev/null ``` 2. **Check balance**: ```bash kraken balance -o json 2>/dev/null ``` 3. **Confirm pair is tradable**: ```bash kraken pairs --pair BTCUSD -o json 2>/dev/null ``` 4. **Validate a sample order** (does not execute): ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 --validate -o json 2>/dev/null ``` 5. **Enable dead man's switch**: ```bash kraken order cancel-after 600 -o json 2>/dev/null ``` ### Futures Before the first live futures trade: 1. **Verify futures credentials**: ```bash kraken futures accounts -o json 2>/dev/null ``` 2. **Check margin availability**: ```bash kraken futures accounts -o json 2>/dev/null ``` 3. **Confirm instrument is tradable**: ```bash kraken futures instrument-status --symbol PF_XBTUSD -o json 2>/dev/null ``` 4. **Set leverage**: ```bash kraken futures set-leverage PF_XBTUSD 10 -o json 2>/dev/null ``` 5. **Enable dead man's switch**: ```bash kraken futures cancel-after 600 -o json 2>/dev/null ``` ## Command Migration Paper and live commands differ only in the prefix. ### Spot | Paper | Live | |-------|------| | `kraken paper buy BTCUSD 0.01` | `kraken order buy BTCUSD 0.01` | | `kraken paper sell BTCUSD 0.01` | `kraken order sell BTCUSD 0.01` | | `kraken paper status` | `kraken balance` + `kraken open-orders` | | `kraken paper orders` | `kraken open-orders` | | `kraken paper history` | `kraken trades-history` | | `kraken paper cancel <ID>` | `kraken order cancel <TXID>` | ### Futures | Paper | Live | |-------|------| | `kraken futures paper buy PF_XBTUSD 1 --leverage 10 --type market` | `kraken futures order buy PF_XBTUSD 1 --type market` | | `kraken futures paper sell PF_XBTUSD 1 --leverage 10 --type market` | `kraken futures order sell PF_XBTUSD 1 --type market` | | `kraken futures paper positions` | `kraken futures positions` | | `kraken futures paper orders` | `kraken futures open-orders` | | `kraken futures paper fills` | `kraken futures fills` | | `kraken futures paper cancel --order-id <ID>` | `kraken futures cancel --order-id <ID>` | | `kraken futures paper cancel-all` | `kraken futures cancel-all` | **Leverage note:** Paper accepts `--leverage` inline on buy/sell commands. Live futures configures leverage separately via `kraken futures set-leverage <SYMBOL> <LEVERAGE>` before placing orders. ## Gradual Promotion Start with smaller size than paper: 1. **Paper size**: the volume used during testing. 2. **Initial live size**: 10-25% of paper size. 3. **Scale up**: increase gradually after confirming live behavior matches paper. ## Live Session Safety After going live, maintain these controls: - Dead man's switch refreshed periodically. - Balance check after every trade. - Open orders verified after every placement. - Error handling active for all error categories. - Maximum loss threshold that triggers session shutdown. ## Rollback If live behavior diverges from paper: ### Spot 1. Cancel all open spot orders: ```bash kraken order cancel-all -o json 2>/dev/null ``` 2. Assess balances. 3. Return to `kraken paper` to debug. ### Futures 1. Cancel all open futures orders: ```bash kraken futures cancel-all -o json 2>/dev/null ``` 2. Close open positions with `--reduce-only`. 3. Return to `kraken futures paper` to debug. ## Hard Rules - Never promote without explicit user sign-off. - Start at reduced size. - Always validate live orders before executing. - Maintain dead man's switch throughout the live session. - First live session should run at autonomy level 3 (supervised) regardless of prior paper autonomy.

kraken-portfolio-intel

Portfolio analysis, P&L tracking, trade history, and export reports.

# kraken-portfolio-intel Use this skill for: - reading balances and computing portfolio value - tracking trade history and P&L - analyzing fee impact and volume tiers - exporting reports for external analysis ## Balance Overview Simple balance: ```bash kraken balance -o json 2>/dev/null ``` Extended balance (includes credit and held amounts): ```bash kraken extended-balance -o json 2>/dev/null ``` Trade balance (margin, equity, free margin): ```bash kraken trade-balance --asset USD -o json 2>/dev/null ``` ## Portfolio Valuation Combine balances with current prices to compute total portfolio value: ```bash # Get all balances kraken balance -o json 2>/dev/null # Get prices for held assets kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null # Agent calculates: # value_per_asset = balance * price # total_value = sum of all values # weight_per_asset = value / total_value ``` ## Trade History Recent trades: ```bash kraken trades-history -o json 2>/dev/null ``` With ledger entries for cost basis: ```bash kraken trades-history --ledgers -o json 2>/dev/null ``` Consolidated taker trades (merge partial fills): ```bash kraken trades-history --consolidate-taker -o json 2>/dev/null ``` Time-filtered: ```bash kraken closed-orders --start 1704067200 --end 1706745600 -o json 2>/dev/null ``` Query specific trades by TXID: ```bash kraken query-trades <TXID1> <TXID2> -o json 2>/dev/null ``` ## Ledger Analysis View all ledger entries (trades, deposits, withdrawals, staking): ```bash kraken ledgers -o json 2>/dev/null ``` Filter by type: ```bash kraken ledgers --type trade -o json 2>/dev/null kraken ledgers --type deposit -o json 2>/dev/null kraken ledgers --type withdrawal -o json 2>/dev/null kraken ledgers --type staking -o json 2>/dev/null ``` Filter by asset: ```bash kraken ledgers --asset BTC -o json 2>/dev/null ``` Time range: ```bash kraken ledgers --asset BTC --type trade --start 1704067200 --end 1706745600 -o json 2>/dev/null ``` ## Fee Analysis Check current volume and fee tier: ```bash kraken volume --pair BTCUSD -o json 2>/dev/null ``` The response includes 30-day volume and the corresponding maker/taker fee rates. ## Export Reports Request a trade or ledger export for offline analysis: ```bash kraken export-report --report trades --description "Q1 2024 trades" --format CSV --starttm 1704067200 --endtm 1711929600 -o json 2>/dev/null ``` Check export status: ```bash kraken export-status --report trades -o json 2>/dev/null ``` Download when ready: ```bash kraken export-retrieve <REPORT_ID> -o json 2>/dev/null ``` Clean up old reports: ```bash kraken export-delete <REPORT_ID> -o json 2>/dev/null ``` ## Futures Portfolio Futures account summary: ```bash kraken futures accounts -o json 2>/dev/null ``` Futures fill history: ```bash kraken futures fills --since 2024-01-01T00:00:00Z -o json 2>/dev/null ``` Futures execution history: ```bash kraken futures history-executions --sort desc -o json 2>/dev/null ``` Futures account log (CSV export): ```bash kraken futures history-account-log-csv --since 2024-01-01T00:00:00Z -o json 2>/dev/null ``` ## Open Positions Spot margin positions: ```bash kraken positions --show-pnl -o json 2>/dev/null ``` Futures positions: ```bash kraken futures positions -o json 2>/dev/null ``` ## Context Efficiency - Use `--offset` and `--limit` for paginated queries. - Use `--without-count` on large history queries to skip count computation. - Filter by asset and time range to reduce response size. - Use exports for bulk data instead of paginating through REST.

kraken-rate-limits

Understand Kraken API rate limits and adapt agent behavior when limits are hit.

# kraken-rate-limits Use this skill for: - understanding Kraken's rate limit systems (Spot REST, trading engine, Futures) - adapting agent behavior when rate limit errors occur - choosing optimal request patterns (WebSocket vs REST, batch vs individual) ## How Rate Limiting Works The CLI does not pre-throttle or retry rate-limited requests. The Kraken API server enforces rate limits. When a limit is hit, the CLI returns the error immediately with structured fields: ```json { "error": "rate_limit", "message": "Spot REST API rate limit exceeded ...", "suggestion": "Wait 5-15 seconds before retrying. ...", "retryable": true, "docs_url": "https://docs.kraken.com/api/docs/guides/spot-rest-ratelimits/" } ``` Read the `suggestion` field to understand what limit was hit and how to adapt. ## Kraken's Rate Limit Systems ### 1. Spot REST Counter Counter-decay model. Each call adds to a counter; the counter decays over time. | Tier | Max Counter | Decay Rate | |------|-------------|------------| | Starter | 15 | 0.33/s | | Intermediate | 20 | 0.5/s | | Pro | 20 | 1.0/s | Most calls cost 1 point. Ledgers, trade history, and query-ledgers cost 2. AddOrder and CancelOrder are excluded from this counter (they use the trading engine limiter instead). Docs: https://docs.kraken.com/api/docs/guides/spot-rest-ratelimits/ ### 2. Spot Trading Engine (per-pair) Separate per-pair counter with penalties for short-lived orders: | Tier | Threshold | Decay Rate | |------|-----------|------------| | Starter | 60 | 1/s | | Intermediate | 125 | 2.34/s | | Pro | 180 | 3.75/s | Cancel within 5 seconds costs +8, amend within 5 seconds costs +3. Let orders rest longer to reduce cost. Docs: https://docs.kraken.com/api/docs/guides/spot-ratelimits ### 3. Futures Cost Budget Cost-based system with two separate pools: - `/derivatives` endpoints: budget of 500 per 10 seconds. `sendorder` costs 10, `editorder` costs 10, `cancelorder` costs 10, `batchorder` costs 9 + batch size, `cancelallorders` costs 25, `accounts` costs 2. - `/history` endpoints: pool of 100 tokens, refills at 100 per 10 minutes. Docs: https://docs.kraken.com/api/docs/guides/futures-rate-limits/ ## Agent Strategies ### Prefer WebSocket over REST polling Streaming does not consume REST rate limit points. For real-time data, always prefer: ```bash kraken ws ticker BTC/USD -o json 2>/dev/null ``` ### Use batch orders Batch orders cost less per-order on both Spot and Futures. Up to 15 orders per batch on Spot. ### Read the suggestion field When a rate limit error is returned, the `suggestion` field contains the specific limit that was hit and concrete advice. Parse it and adapt: ```bash RESULT=$(kraken balance -o json 2>/dev/null) if [ $? -ne 0 ]; then CATEGORY=$(echo "$RESULT" | jq -r '.error // "unknown"') if [ "$CATEGORY" = "rate_limit" ]; then SUGGESTION=$(echo "$RESULT" | jq -r '.suggestion // "Wait and retry"') DOCS=$(echo "$RESULT" | jq -r '.docs_url // ""') echo "Rate limited. $SUGGESTION" echo "Read more: $DOCS" fi fi ``` ### Multi-command budget planning Before executing a sequence, estimate total cost: ```bash # This sequence costs ~5 points on the Spot REST counter: kraken ticker BTCUSD -o json 2>/dev/null # 1 point kraken balance -o json 2>/dev/null # 1 point kraken open-orders -o json 2>/dev/null # 1 point kraken trades-history -o json 2>/dev/null # 2 points (heavy call) ``` Leave headroom for retries and unexpected calls.

recipe-emergency-flatten

Cancel all orders and close all positions in an emergency.

# Emergency Flatten > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-risk-operations`, `kraken-liquidation-guard` Immediately cancel all orders and close all positions across spot and futures. > **CAUTION:** This closes everything at market prices. Slippage may be significant. The `--yes` flag skips confirmation prompts and is only appropriate at autonomy level 4+ (see `kraken-autonomy-levels`). At lower levels, omit `--yes` and confirm each cancel with the user. ## Steps 1. Cancel all spot orders (dangerous): `kraken order cancel-all --yes -o json 2>/dev/null` 2. Cancel all futures orders (dangerous): `kraken futures cancel-all --yes -o json 2>/dev/null` 3. Check spot positions: `kraken positions -o json 2>/dev/null` 4. Close each spot margin position with a market order (requires human approval) 5. Check futures positions and extract sizes: `kraken futures positions -o json 2>/dev/null` (parse each position's `size` and `side` fields) 6. Close each futures position with reduce-only market orders (use `sell` for longs, `buy` for shorts): e.g., `kraken futures order sell PF_XBTUSD 1 --reduce-only -o json 2>/dev/null` 7. Verify no open orders remain: `kraken open-orders -o json 2>/dev/null` 8. Verify no futures orders remain: `kraken futures open-orders -o json 2>/dev/null` 9. Verify all positions closed: `kraken futures positions -o json 2>/dev/null` 10. Check final balances: `kraken balance -o json 2>/dev/null`

kraken-rebalancing

Portfolio rebalancing to maintain target allocations across assets.

# kraken-rebalancing Use this skill for: - checking current portfolio allocation vs target weights - calculating rebalance trades - executing rebalance orders with minimum trade thresholds - scheduling periodic rebalance checks ## Define Target Allocation Example target: 50% BTC, 30% ETH, 20% SOL (by USD value). The agent maintains these weights and compares against current holdings. ## Read Current Portfolio 1. Get balances: ```bash kraken balance -o json 2>/dev/null ``` 2. Get current prices for all held assets: ```bash 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. ## Calculate Rebalance Trades For each asset: - Target value = total_portfolio * target_weight - Current value = holdings * current_price - Delta = target_value - current_value - If delta > threshold: buy (delta / price) units - If delta < -threshold: sell (|delta| / price) units Set a minimum trade threshold (e.g., $50) to avoid placing tiny orders that waste fees. ## Paper Rebalance Test ```bash kraken paper init --balance 10000 -o json 2>/dev/null # 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 paper 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 paper status -o json 2>/dev/null ``` ## Live Rebalance Execution 1. Calculate all required trades. 2. Present the rebalance plan to the user: - Current allocation vs target - Proposed trades with estimated fees 3. Validate each order: ```bash 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): ```bash 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: ```bash kraken balance -o json 2>/dev/null ``` ## Drift Detection Periodically compare current weights to targets. Trigger rebalance when any asset drifts beyond a threshold (e.g., 5% absolute drift): ```bash # Agent checks balance and prices on a schedule # If |current_weight - target_weight| > 0.05 for any asset → rebalance ``` ## Rebalance with Limit Orders For lower fees, use limit orders instead of market: ```bash PRICE=$(kraken ticker SOLUSD -o json 2>/dev/null | jq -r '.[].a[0]') kraken order buy SOLUSD 2 --type limit --price $PRICE -o json 2>/dev/null ``` Check fills before declaring rebalance complete: ```bash kraken open-orders -o json 2>/dev/null ``` ## Hard Rules - Never execute rebalance trades without explicit human approval. - Always present the full rebalance plan (sells and buys) before execution. - Execute sells before buys to ensure sufficient quote currency. - Respect minimum order sizes for each pair (check pair info with `kraken pairs`). - Apply a minimum trade threshold to skip negligible adjustments.

recipe-fee-tier-progress

Track 30-day trading volume progress toward the next fee tier.

# Fee Tier Progress > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-fee-optimization` Check current 30-day volume and calculate how far you are from the next fee tier. ## Steps 1. Get current volume and fee tier: `kraken volume --pair BTCUSD -o json 2>/dev/null` 2. Extract `volume` (30-day USD) and current `fee` rates 3. Look up the next tier threshold from the fee schedule 4. Calculate remaining volume needed: next_threshold - current_volume 5. Estimate days to reach at current daily average 6. Check futures volume if applicable: `kraken futures fee-schedule-volumes -o json 2>/dev/null` 7. Present summary: current tier, current volume, next tier threshold, volume remaining, estimated days

kraken-risk-operations

Operational risk controls for live agent trading sessions.

# kraken-risk-operations Use this skill to reduce live-trading risk during automation. ## Pre-Flight Checklist 1. Confirm intended environment (paper vs live). 2. Confirm pair, side, volume, and order type. 3. Validate payload with `--validate`. 4. Enable a dead-man switch for unattended sessions. ## Live Session Safety Commands Dead-man switch: ```bash kraken order cancel-after 60 -o json 2>/dev/null ``` Mass cancel: ```bash kraken order cancel-all -o json 2>/dev/null kraken futures cancel-all -o json 2>/dev/null ``` Position visibility: ```bash kraken open-orders -o json 2>/dev/null kraken positions -o json 2>/dev/null kraken futures positions -o json 2>/dev/null ``` ## Failure Handling - `network`: exponential backoff retry - `rate_limit`: read `suggestion` and `docs_url` fields, reduce call frequency or switch to WebSocket - `auth`: stop and refresh credentials - `validation` or `api`: stop, fix request, do not blind retry ## Hard Rules - All cancel and cancel-all operations are dangerous. Require explicit human approval before executing. - Dead-man switch (`cancel-after`) is also dangerous; confirm the timeout value with the user. - Never execute mass-cancel without verifying which orders and positions are open first.

kraken-setup

Install kraken-cli, create API credentials, and go from paper trading to live in under five minutes.

# kraken-setup First-run setup for `kraken-cli`. Covers install, credentials, paper trading, and handing off to an MCP client. Use this skill when a user says "set up kraken-cli", "install kraken", "get started", or similar. For wiring the running CLI into Claude, Cursor, Codex, or Gemini, hand off to `kraken-mcp-integration`. ## 1. Install the CLI Pick one. All three land a `kraken` binary on your PATH. ```bash # Homebrew (macOS, Linux) brew tap krakenfx/kraken-cli && brew install kraken-cli # Cargo (any platform with Rust >= 1.77) cargo install kraken-cli # Prebuilt binary # Download from https://github.com/krakenfx/kraken-cli/releases and move `kraken` into a directory on $PATH ``` Verify: ```bash kraken --version ``` ## 2. Start with paper trading Paper trading uses live prices with a simulated balance. No API keys required. Start here. ```bash kraken paper init --balance 10000 -o json kraken paper buy BTCUSD 0.01 -o json kraken paper status -o json ``` Futures paper trading works the same way: ```bash kraken futures paper init --balance 10000 -o json kraken futures paper buy PF_XBTUSD 1 --leverage 10 --type market -o json kraken futures paper positions -o json ``` Public market data also needs no credentials: ```bash kraken ticker BTCUSD -o json kraken orderbook BTCUSD --count 10 -o json ``` Most agent workflows can do their entire first session on paper and public data. ## 3. (Optional) Add API credentials for live trading Only needed if you want to query your real account or place real orders. ### Recommended key scope Generate the narrowest key you can live with. An AI agent should never be able to move funds off the exchange. - **Never enable `Withdraw Funds`.** Without this permission, even a prompt-injection or credential-exfiltration attack cannot remove assets from your Kraken account. - **Start read-only.** `Query Funds`, `Query Open Orders & Trades`, and `Query Closed Orders & Trades` are safe for a first session. - **Add trading scopes only when you need them.** `Create & Modify Orders` and `Cancel/Close Orders` unlock live trading; no other scope is required for spot. - **Enable IP allowlisting if the agent runs from a static IP.** Kraken's API settings page lets you lock a key to one or more source IPs. - **Rotate on host change.** If you switch machines or re-install the plugin, revoke the old key and generate a new one. Manage keys at <https://www.kraken.com/u/security/api>. ### Provide the key and secret to your agent The CLI resolves credentials from three tiers, in order: command-line flags (`--api-key` / `--api-secret`), environment variables (`KRAKEN_API_KEY` / `KRAKEN_API_SECRET`), then a secure local config file managed by the CLI (written by `kraken auth set` or `kraken setup`, stored with user-only permissions under your OS's standard config directory). Pick the path that matches your client. #### Claude Code (install-time prompt) When you enable the `kraken-cli` plugin from the Plugin Directory, Claude prompts for `api_key` and `api_secret` and stores them in your macOS Keychain. Paste the key and secret, or press Enter on both prompts to stay on paper + market-only. Claude wires the values into the MCP server's environment automatically; no shell exports required. If you leave the `userConfig` fields blank, the plugin starts with no environment credentials and falls through to whatever the CLI's local config file contains. That means a user who previously ran `kraken auth set` on the same machine will have those CLI credentials available to the plugin. If you want the plugin to be strictly credential-less until you opt in, leave the prompt blank AND clear the config file with `kraken auth reset` before starting Claude. #### Cursor, Codex, Gemini CLI These hosts do not have Claude's install-time prompt. Either export credentials in the shell that launches the agent: ```bash export KRAKEN_API_KEY="your-key" export KRAKEN_API_SECRET="your-secret" ``` …or rely on the credentials you stored with `kraken auth set` — the plugin reads the same config file as the standalone CLI, so a single `kraken auth set` serves both. For futures, use a Kraken Futures key and set `KRAKEN_FUTURES_API_KEY` and `KRAKEN_FUTURES_API_SECRET` alongside the spot pair, or run `kraken auth set --futures-api-key ... --futures-api-secret ...` once and let the config file supply them. #### Plain CLI use (not through a plugin) `kraken auth set` writes credentials to a secure local config file managed by the CLI (stored with user-only permissions in your OS's standard config directory). `kraken auth show` displays the stored key masked as `****wxyz` and the secret as `[REDACTED]`, so you can confirm which key is configured without exposing it. `kraken auth reset` clears the stored credentials. ### Verify ```bash kraken balance -o json ``` Never commit these values. `.env` and `.env.*` are already gitignored in the repo. ## 4. Connect an MCP client The CLI ships with a built-in MCP server. Point any MCP-compatible client (Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, VS Code, Windsurf) at it. See `skills/kraken-mcp-integration/SKILL.md` for the per-client config blocks and the full service reference. The default MCP config in every `kraken-cli` marketplace listing (Claude, Cursor, Codex, Gemini) is `-s market,paper`: | Service | Auth | Why it's in the default | |---------|------|-------------------------| | `market` | None | Public price data, orderbooks, OHLC. | | `paper` | None | Simulated trading with live prices. | A fresh install can never place a real order. Live trading is an explicit opt-in: widen the service list in your MCP client's config to `-s market,trade,paper` (adds live spot orders) or `-s all` (everything, including funding and earn). See the service table and the "Enabling live trading" section in `skills/kraken-mcp-integration/SKILL.md` for the complete list and recommended progression. ## 5. Safety defaults - Commands flagged `dangerous` in `agents/tool-catalog.json` require explicit user confirmation. MCP surfaces this via the `destructive_hint` annotation. - Always try `--validate` before submitting an order. - Run paper-first, live-second. `skills/kraken-paper-to-live/SKILL.md` covers the promotion checklist. ## Troubleshooting **`kraken: command not found`**: the install directory isn't on `$PATH`. For Homebrew: run `brew doctor`. For Cargo: ensure `~/.cargo/bin` is on `$PATH`. **`auth` error on every command**: you exported a key with insufficient permissions. Regenerate with the scopes above. **Futures commands fail with `auth` but spot works**: futures needs its own key. Set `KRAKEN_FUTURES_API_KEY` and `KRAKEN_FUTURES_API_SECRET`. **MCP client shows no Kraken tools**: confirm `kraken` is on the PATH the client sees (MCP clients often launch from a minimal shell). Then see `kraken-mcp-integration` troubleshooting.

kraken-shared

Shared runtime contract for kraken-cli: auth, invocation, parsing, and safety.

# kraken-shared **This tool is experimental. Commands execute real financial transactions on the Kraken exchange. Test with `kraken paper` before using real funds. See `DISCLAIMER.md` for full terms.** ## Invocation Contract Always call: ```bash kraken <command> [args...] -o json 2>/dev/null ``` Rules: - Parse `stdout` only. - Treat `stderr` as diagnostics. - Exit code `0` means success. - Non-zero exit means failure with JSON envelope in `stdout`. ## Authentication ```bash export KRAKEN_API_KEY="your-key" export KRAKEN_API_SECRET="your-secret" ``` Optional futures credentials: ```bash export KRAKEN_FUTURES_API_KEY="your-futures-key" export KRAKEN_FUTURES_API_SECRET="your-futures-secret" ``` Public market data and paper trading require no credentials. ## Error Routing Route on `.error`: - `auth`: re-authenticate - `rate_limit`: read `suggestion` and `docs_url` fields, adapt strategy - `network`: retry with exponential backoff - `validation`: fix inputs, do not retry unchanged request - `api`: inspect request parameters ## Safety The catalog marks 32 commands as `dangerous: true`. Always check the `dangerous` field in `agents/tool-catalog.json` before executing a command. Require explicit human approval before: - live buy or sell orders (spot and futures) - order amendments, edits, and batch operations - cancel and cancel-all operations - withdrawals and wallet transfers - earn allocate/deallocate - subaccount transfers - WebSocket order mutations Use paper trading for dry runs: ```bash kraken paper init --balance 10000 -o json ```

kraken-spot-execution

Execute spot orders with validation, confirmation gates, and post-trade checks.

# kraken-spot-execution Use this skill for: - placing spot buy or sell orders - validating order payloads before submit - checking open orders and trade history ## Safe Execution Flow 1. Read price: ```bash kraken ticker BTCUSD -o json 2>/dev/null ``` 2. Validate order: ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 --validate -o json 2>/dev/null ``` 3. Ask for explicit human confirmation. 4. Execute order: ```bash kraken order buy BTCUSD 0.001 --type limit --price 50000 -o json 2>/dev/null ``` 5. Verify placement: ```bash kraken open-orders -o json 2>/dev/null ``` ## Cancel and Safety - Cancel one: ```bash kraken order cancel <TXID> -o json 2>/dev/null ``` - Dead-man switch: ```bash kraken order cancel-after 60 -o json 2>/dev/null ``` ## Hard Rules - Never execute live order commands without explicit user approval. - Route failures by `.error` category. - On `rate_limit`, read `suggestion` and `docs_url` fields, then adapt strategy.

kraken-stop-take-profit

Manage stop-loss and take-profit orders for risk-bounded positions.

# kraken-stop-take-profit Use this skill for: - placing stop-loss orders to limit downside - placing take-profit orders to lock in gains - building bracket orders (entry + stop + target) - trailing stops that follow a rising price ## Simple Stop-Loss After buying, place a stop-loss below entry: ```bash # Entry kraken order buy BTCUSD 0.01 --type limit --price 60000 -o json 2>/dev/null # Stop-loss (triggers market sell if price drops to 57000) kraken order sell BTCUSD 0.01 --type stop-loss --price 57000 -o json 2>/dev/null ``` ## Simple Take-Profit Place a take-profit above entry: ```bash # Take-profit (triggers market sell if price rises to 65000) kraken order sell BTCUSD 0.01 --type take-profit --price 65000 -o json 2>/dev/null ``` ## Bracket Order (Entry + Stop + Target) Place all three as separate orders: ```bash # 1. Entry kraken order buy BTCUSD 0.01 --type limit --price 60000 -o json 2>/dev/null # 2. Stop-loss kraken order sell BTCUSD 0.01 --type stop-loss --price 57000 -o json 2>/dev/null # 3. Take-profit kraken order sell BTCUSD 0.01 --type take-profit --price 65000 -o json 2>/dev/null ``` When one exit fills, cancel the other to avoid double exposure: ```bash kraken order cancel <OTHER_TXID> -o json 2>/dev/null ``` ## Stop-Loss Limit (Tighter Control) A stop-loss-limit triggers a limit order instead of market, giving price control but risking no fill in fast moves: ```bash kraken order sell BTCUSD 0.01 --type stop-loss-limit --price 57000 --price2 56800 -o json 2>/dev/null ``` `--price` is the trigger, `--price2` is the limit price for the resulting order. ## Trailing Stop Follows the market up, sells on reversal: ```bash # Trail $500 below the high kraken order sell BTCUSD 0.01 --type trailing-stop --price +500 -o json 2>/dev/null ``` As BTC rises from 60000 to 65000, the stop moves from 59500 to 64500. On a $500 drop from any high, it triggers. ## Futures Stop-Loss ```bash kraken futures order sell PF_XBTUSD 1 --type stop --stop-price 57000 --trigger-signal mark --reduce-only -o json 2>/dev/null ``` Use `--trigger-signal mark` or `index` to avoid stop hunts on last-trade wicks. Use `--reduce-only` to prevent the stop from opening a short. ## Management Loop Monitor stops after placement: ```bash kraken open-orders -o json 2>/dev/null ``` Stream execution updates to detect when a stop triggers: ```bash kraken ws executions -o json 2>/dev/null ``` When one side of a bracket fills, immediately cancel the other. ## Hard Rules - Never place live stop/take-profit orders without explicit human approval. - Always cancel the opposite leg when one side of a bracket fills. - Use `--reduce-only` on futures exits to prevent accidental position flips. - Validate all orders before submission with `--validate`.

kraken-subaccount-ops

Create and manage subaccounts with inter-account transfers.

# kraken-subaccount-ops Use this skill for: - creating subaccounts for strategy isolation - transferring funds between main and subaccounts - managing futures subaccount trading status - isolating risk across multiple strategies ## Why Subaccounts Subaccounts isolate balances and positions. Use them to: - Run different strategies with separate capital pools. - Limit risk exposure per strategy. - Track P&L per strategy independently. - Give different agents access to different subaccounts with restricted API keys. ## Create a Subaccount ```bash kraken subaccount create "dca-bot" "dca-bot@example.com" -o json 2>/dev/null ``` ## Transfer Between Accounts Move funds from main account to subaccount (requires human approval): ```bash kraken subaccount transfer USD 5000 --from <MAIN_IIBAN> --to <SUB_IIBAN> -o json 2>/dev/null ``` Move funds back: ```bash kraken subaccount transfer USD 5000 --from <SUB_IIBAN> --to <MAIN_IIBAN> -o json 2>/dev/null ``` ## Futures Subaccounts List futures subaccounts: ```bash kraken futures subaccounts -o json 2>/dev/null ``` Check subaccount trading status: ```bash kraken futures subaccount-status <UID> -o json 2>/dev/null ``` Enable or disable trading for a subaccount: ```bash kraken futures set-subaccount-status <UID> true -o json 2>/dev/null kraken futures set-subaccount-status <UID> false -o json 2>/dev/null ``` Transfer between futures wallets: ```bash kraken futures wallet-transfer <FROM_WALLET> <TO_WALLET> USD 1000 -o json 2>/dev/null ``` ## Strategy Isolation Pattern 1. Create a subaccount per strategy (e.g., "grid-btc", "dca-eth"). 2. Allocate capital to each subaccount. 3. Configure separate API keys per subaccount with minimum required permissions. 4. Each agent operates only within its assigned subaccount. 5. The main account retains reserve capital not allocated to any strategy. ## Monitoring Check all balances from the main account to see aggregate state. Individual subaccount balances are visible through their respective API keys. For centralized monitoring, use the main account's credentials with query permissions across subaccounts. ## Hard Rules - Subaccount transfers are flagged as dangerous. Never execute without explicit human approval. - Never share API keys across subaccounts; create separate keys per subaccount. - Verify IIBAN values before initiating transfers; incorrect IIBANs will fail. - Disable futures trading on subaccounts that should not trade futures.

recipe-funding-rate-scan

Scan perpetual contracts for attractive funding rate carry opportunities.

# Funding Rate Scan > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-funding-carry`, `kraken-futures-risk` Scan available perpetual contracts, identify those with high funding rates, and evaluate carry potential. ## Steps 1. List all futures contracts: `kraken futures instruments -o json 2>/dev/null` 2. Get all tickers: `kraken futures tickers -o json 2>/dev/null` 3. Check funding rates for top-volume contracts: - `kraken futures historical-funding-rates PF_XBTUSD -o json 2>/dev/null` - `kraken futures historical-funding-rates PF_ETHUSD -o json 2>/dev/null` - `kraken futures historical-funding-rates PF_SOLUSD -o json 2>/dev/null` 4. Rank by annualized yield (rate * periods_per_year * 100) 5. Filter for consistently positive or negative rates (avoid noisy oscillations) 6. Check spot price for hedge calculation: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 7. Check futures account margin: `kraken futures accounts -o json 2>/dev/null` 8. Present ranked opportunities with annualized yield, direction, and required margin

recipe-futures-hedge-spot

Hedge a spot holding with a short futures position to lock in value.

# Hedge Spot with Futures > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-spot-execution`, `kraken-futures-trading`, `kraken-futures-risk` Protect a spot BTC holding from downside by shorting an equivalent futures position. > **CAUTION:** This locks in current value but also caps upside. Futures margin requirements apply. ## Steps 1. Check spot balance: `kraken balance -o json 2>/dev/null` 2. Get spot price: `kraken ticker BTCUSD -o json 2>/dev/null` 3. Get futures price: `kraken futures ticker PF_XBTUSD -o json 2>/dev/null` 4. Check futures margin availability: `kraken futures accounts -o json 2>/dev/null` 5. Calculate matching futures size: `BTC_BAL=$(kraken balance -o json 2>/dev/null | jq -r '.XXBT // .XBT // "0"')` and `FUT_PRICE=$(kraken futures ticker PF_XBTUSD -o json 2>/dev/null | jq -r '.ticker.last')` 6. Open short futures position (requires human approval): `kraken futures order sell PF_XBTUSD $BTC_BAL --type limit --price $FUT_PRICE -o json 2>/dev/null` 7. Verify the position: `kraken futures positions -o json 2>/dev/null` 8. Enable dead man's switch: `kraken futures cancel-after 3600 -o json 2>/dev/null` 9. Monitor margin: `kraken futures accounts -o json 2>/dev/null` 10. To remove hedge, close futures: `kraken futures order buy PF_XBTUSD $BTC_BAL --reduce-only -o json 2>/dev/null`

recipe-launch-grid-bot

Deploy a grid trading bot with paper validation and live safety controls.

# Launch a Grid Bot > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-grid-trading`, `kraken-paper-to-live` Deploy a grid of buy and sell orders across a price range. > **CAUTION:** Grids profit in ranging markets but lose in strong trends. Always paper-test first. ## Steps 1. Get current price: `PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]')` 2. Compute grid levels (e.g., 3 levels at $1000 spacing): `BUY1=$(echo "$PRICE - 1000" | bc)`, `BUY2=$(echo "$PRICE - 2000" | bc)`, `BUY3=$(echo "$PRICE - 3000" | bc)`, `SELL1=$(echo "$PRICE + 1000" | bc)`, `SELL2=$(echo "$PRICE + 2000" | bc)`, `SELL3=$(echo "$PRICE + 3000" | bc)` 3. Paper-test the grid: `kraken paper init --balance 10000 -o json 2>/dev/null` 4. Place paper buy levels: `kraken paper buy BTCUSD 0.001 --type limit --price $BUY1 -o json 2>/dev/null` (repeat for BUY2, BUY3) 5. Place paper sell levels: `kraken paper sell BTCUSD 0.001 --type limit --price $SELL1 -o json 2>/dev/null` (repeat for SELL2, SELL3) 5. Monitor paper fills: `kraken paper orders -o json 2>/dev/null` 6. Review paper results: `kraken paper status -o json 2>/dev/null` 7. Pre-flight live: `kraken auth test -o json 2>/dev/null && kraken balance -o json 2>/dev/null` 8. Enable dead man's switch: `kraken order cancel-after 3600 -o json 2>/dev/null` 10. Validate live grid orders: `kraken order buy BTCUSD 0.001 --type limit --price $BUY1 --validate -o json 2>/dev/null` 11. Place live grid (requires human approval): place buy and sell levels sequentially using $BUY1-3 and $SELL1-3 11. Monitor fills: `kraken ws executions -o json 2>/dev/null` 12. Replace filled levels: when a buy fills, place a sell one level up, and vice versa

recipe-morning-market-brief

Generate a morning market summary with prices, volume, and portfolio state.

# Morning Market Brief > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-market-intel`, `kraken-portfolio-intel` Generate a concise morning summary covering market conditions and portfolio state. ## Steps 1. Check system status: `kraken status -o json 2>/dev/null` 2. Get prices for core watchlist: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 3. Get 24h OHLC for trend context: `kraken ohlc BTCUSD --interval 1440 -o json 2>/dev/null` 4. Check portfolio balances: `kraken balance -o json 2>/dev/null` 5. Check open orders: `kraken open-orders -o json 2>/dev/null` 6. Check futures positions if applicable: `kraken futures positions -o json 2>/dev/null` 7. Check earn allocations: `kraken earn allocations --hide-zero-allocations -o json 2>/dev/null` 8. Present summary: price table, 24h change, portfolio value, open orders count, position P&L

recipe-multi-pair-breakout-watch

Monitor multiple pairs for price breakouts from defined ranges.

# Multi-Pair Breakout Watch > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-multi-pair`, `kraken-alert-patterns` Watch a set of pairs for breakouts above resistance or below support levels. ## Steps 1. Define watchlist pairs and levels (agent maintains these): - BTCUSD: support 55000, resistance 65000 - ETHUSD: support 2800, resistance 3500 - SOLUSD: support 80, resistance 120 2. Get baseline OHLC for context: `kraken ohlc BTCUSD --interval 60 -o json 2>/dev/null` 3. Start streaming: `kraken ws ticker BTC/USD ETH/USD SOL/USD -o json 2>/dev/null` 4. Parse each NDJSON line: extract pair and last price 5. Compare last price to support/resistance levels 6. On breakout detection: alert the user with pair, direction, price, and level crossed 7. Optionally check volume to confirm breakout strength: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 8. Present breakout candidates ranked by volume confirmation

recipe-paper-strategy-backtest

Backtest a trading strategy using paper trading against live prices.

# Paper Strategy Backtest > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-paper-strategy` Run a strategy through multiple paper sessions to validate consistency before live deployment. ## Important: Paper Results Overstate Live Performance Paper trading fills at the exact quoted price with no fees, no slippage, and no partial fills. Live trading on Kraken incurs maker/taker fees (0.16%/0.26% at base tier), slippage on market orders, and possible partial fills on limit orders. When comparing session results in step 9 below, subtract at least 0.26% per fill from paper returns to get a more realistic estimate. A strategy that is only marginally profitable on paper is likely unprofitable live. ## Steps 1. Define strategy parameters (pair, entry/exit rules, position size) 2. Initialize paper account: `kraken paper init --balance 10000 -o json 2>/dev/null` 3. Run session 1: execute strategy logic using paper buy/sell commands 4. Record session 1 results: `kraken paper status -o json 2>/dev/null` + `kraken paper history -o json 2>/dev/null` 5. Reset: `kraken paper reset -o json 2>/dev/null` 6. Run session 2 with same parameters at a different time (different market conditions) 7. Record session 2 results 8. Repeat for 3-5 sessions minimum 9. Compare results: win rate, average P&L per trade, max drawdown, Sharpe-like ratio 10. If results are consistent and positive, the strategy is a candidate for live promotion 11. If results vary wildly, adjust parameters and re-test

recipe-start-dca-bot

Set up and run a dollar cost averaging bot from paper test to live.

# Start a DCA Bot > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-dca-strategy`, `kraken-paper-to-live` Set up a dollar cost averaging bot that buys a fixed dollar amount of BTC at regular intervals. > **CAUTION:** Live orders spend real money. Paper-test first, then promote with explicit approval. ## Steps 1. Initialize paper account: `kraken paper init --balance 10000 -o json 2>/dev/null` 2. Calculate volume from dollar amount: `PRICE=$(kraken ticker BTCUSD -o json 2>/dev/null | jq -r '.[].c[0]') && VOLUME=$(echo "scale=8; 100 / $PRICE" | bc)` 3. Run 5 paper DCA buys to validate the loop: `kraken paper buy BTCUSD $VOLUME -o json 2>/dev/null` 4. Check paper results: `kraken paper status -o json 2>/dev/null` 5. Review paper trade history: `kraken paper history -o json 2>/dev/null` 6. Verify live credentials: `kraken auth test -o json 2>/dev/null` 7. Check live balance: `kraken balance -o json 2>/dev/null` 8. Validate the live order: `kraken order buy BTCUSD $VOLUME --type market --validate -o json 2>/dev/null` 9. Execute first live buy (requires human approval): `kraken order buy BTCUSD $VOLUME --type market -o json 2>/dev/null` 10. Verify fill: `kraken trades-history -o json 2>/dev/null`

recipe-subaccount-capital-rotation

Rotate capital between subaccounts based on strategy performance.

# Subaccount Capital Rotation > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-subaccount-ops`, `kraken-portfolio-intel` Evaluate strategy performance per subaccount and reallocate capital to winning strategies. > **CAUTION:** Transfers move real funds. Always confirm IIBANs and amounts. ## Steps 1. Check main account balance: `kraken balance -o json 2>/dev/null` 2. Check each subaccount balance (via their API keys or main account view) 3. Review trade history per subaccount to calculate P&L 4. Rank strategies by risk-adjusted return 5. Calculate new allocation (increase capital for outperformers, reduce for underperformers) 6. Obtain IIBANs from account settings or the Kraken web UI (IIBANs are account-specific identifiers like `ABCD 1234 EFGH 5678`) 7. Transfer from underperforming subaccount to main (requires human approval): `kraken subaccount transfer USD 2000 --from $SUB_IIBAN --to $MAIN_IIBAN -o json 2>/dev/null` 8. Transfer from main to outperforming subaccount: `kraken subaccount transfer USD 2000 --from $MAIN_IIBAN --to $SUB_IIBAN -o json 2>/dev/null` 9. Verify balances after transfers: `kraken balance -o json 2>/dev/null`

recipe-track-orderbook-depth

Monitor order book depth and bid-ask imbalance for liquidity signals.

# Track Order Book Depth > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-market-intel`, `kraken-ws-streaming` Monitor order book depth for a pair and detect bid-ask imbalance as a liquidity signal. ## Steps 1. Get a snapshot: `kraken orderbook BTCUSD --count 25 -o json 2>/dev/null` 2. Sum bid volume (top 10 levels) and ask volume (top 10 levels) 3. Calculate imbalance ratio: bid_volume / (bid_volume + ask_volume) - Ratio > 0.6: strong bid-side (buying pressure) - Ratio < 0.4: strong ask-side (selling pressure) 4. Start streaming for continuous monitoring: `kraken ws book BTC/USD --depth 10 -o json 2>/dev/null` 5. Parse each update and recalculate imbalance 6. Alert when imbalance crosses threshold 7. Optionally compare across pairs (one call per pair): `kraken orderbook BTCUSD --count 10 -o json 2>/dev/null` then `kraken orderbook ETHUSD --count 10 -o json 2>/dev/null`

recipe-trailing-stop-runner

Ride a trend with a trailing stop that locks in profits on reversal.

# Trailing Stop Runner > **PREREQUISITE:** Load the following skills to execute this recipe: `kraken-stop-take-profit`, `kraken-spot-execution` Enter a position and attach a trailing stop to capture trend profits while limiting downside. ## Steps 1. Get current price: `kraken ticker BTCUSD -o json 2>/dev/null` 2. Enter position (requires human approval): `kraken order buy BTCUSD 0.01 --type market -o json 2>/dev/null` 3. Verify fill: `kraken trades-history -o json 2>/dev/null` 4. Set trailing stop (e.g., $500 trail distance): `kraken order sell BTCUSD 0.01 --type trailing-stop --price +500 -o json 2>/dev/null` 5. Verify stop is placed: `kraken open-orders -o json 2>/dev/null` 6. Monitor via stream: `kraken ws ticker BTC/USD -o json 2>/dev/null` 7. When the trailing stop triggers, verify the exit fill: `kraken trades-history -o json 2>/dev/null` 8. Report entry price, exit price, and net P&L

recipe-weekly-rebalance

Run a weekly portfolio rebalance to maintain target asset allocations.

# Weekly Rebalance > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-rebalancing` Check portfolio drift and rebalance to target weights once per week. ## Steps 1. Get balances: `kraken balance -o json 2>/dev/null` 2. Get prices: `kraken ticker BTCUSD ETHUSD SOLUSD -o json 2>/dev/null` 3. Calculate current weights (agent computes USD value per asset / total) 4. Compare to targets (e.g., 50% BTC, 30% ETH, 20% SOL) 5. If any asset drifts more than 5% from target, compute rebalance trades: `SELL_VOL=$(echo "scale=8; ($CURRENT_BTC_VALUE - $TARGET_BTC_VALUE) / $BTC_PRICE" | bc)` and `BUY_VOL=$(echo "scale=8; ($TARGET_SOL_VALUE - $CURRENT_SOL_VALUE) / $SOL_PRICE" | bc)` 6. Present the rebalance plan to the user with estimated fees 7. Validate sell orders: `kraken order sell BTCUSD $SELL_VOL --type market --validate -o json 2>/dev/null` 8. Execute sells first (requires human approval): `kraken order sell BTCUSD $SELL_VOL --type market -o json 2>/dev/null` 9. Execute buys with freed capital: `kraken order buy SOLUSD $BUY_VOL --type market -o json 2>/dev/null` 10. Verify final allocations: `kraken balance -o json 2>/dev/null`

recipe-withdrawal-to-cold-storage

Safely withdraw funds to a pre-approved cold storage address.

# Withdraw to Cold Storage > **PREREQUISITE:** Load the following skill to execute this recipe: `kraken-funding-ops` Withdraw crypto to a pre-approved hardware wallet address with fee checks and status tracking. > **CAUTION:** Withdrawals are irreversible once confirmed on-chain. Triple-check the address. ## Steps 1. Check balance for the asset: `kraken balance -o json 2>/dev/null` 2. List verified withdrawal addresses: `kraken withdrawal addresses --asset BTC --verified true -o json 2>/dev/null` 3. Confirm the target address matches the cold storage address on file 4. Check withdrawal fee: `kraken withdrawal info BTC "cold-storage-btc" 0.5 -o json 2>/dev/null` 5. Present fee and net amount to the user 6. Execute withdrawal (requires explicit human approval): `kraken withdraw BTC "cold-storage-btc" 0.5 -o json 2>/dev/null` 7. Track withdrawal status: `kraken withdrawal status --asset BTC -o json 2>/dev/null` 8. Verify balance reduction: `kraken balance -o json 2>/dev/null`