Agent Skillskrakenfx/kraken-cli › recipe-basis-trade-entry

recipe-basis-trade-entry

GitHub

自动化执行基差套利交易,通过CLI获取现货与期货价格计算溢价,满足阈值时自动下单并验证成交,确保市场中性。

skills/recipe-basis-trade-entry/SKILL.md krakenfx/kraken-cli

Trigger Scenarios

用户需要执行基差套利交易 基差溢价超过设定阈值

Install

npx skills add krakenfx/kraken-cli --skill recipe-basis-trade-entry -g -y
More Options

Use without installing

npx skills use krakenfx/kraken-cli@recipe-basis-trade-entry

指定 Agent (Claude Code)

npx skills add krakenfx/kraken-cli --skill recipe-basis-trade-entry -a claude-code -g -y

安装 repo 全部 skill

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

预览 repo 内 skill

npx skills add krakenfx/kraken-cli --list

SKILL.md

Frontmatter
{
    "name": "recipe-basis-trade-entry",
    "version": "1.0.0",
    "metadata": {
        "openclaw": {
            "domain": "strategy",
            "category": "recipe"
        },
        "requires": {
            "bins": [
                "kraken"
            ],
            "skills": [
                "kraken-basis-trading",
                "kraken-futures-risk"
            ]
        }
    },
    "description": "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 '.[].last_price')
  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

If you hit a mismatch between what you are trying to do and the CLI's interface or responses — including a mismatch between this skill and the installed CLI version's contract — feel free to submit feedback with kraken feedback.

Version History

  • aa56e59 Current 2026-08-20 04:45

    0.4.0版本:更新API响应字段(c[0]改为last_price),新增kraken feedback命令及MCP安全限制。

  • aa32814 2026-07-25 10:29

Same Skill Collection

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

Metadata

Files
0
Version
aa56e59
Hash
f27d3baf
Indexed
2026-07-25 10:29

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