{
  "schemaVersion": "1.0",
  "item": {
    "slug": "vibetrading",
    "name": "VibeTrading",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "canonicalUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/vibetrading",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=vibetrading",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/api-details.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/vibetrading"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/vibetrading",
    "agentPageUrl": "https://openagent3.xyz/skills/vibetrading/agent",
    "manifestUrl": "https://openagent3.xyz/skills/vibetrading/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/vibetrading/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "vibetrading",
        "body": "Agent-first crypto trading framework. Strategies are Python functions decorated with @vibe that call sandbox functions (get_perp_price, long, short, etc.). Same code runs in backtest and live."
      },
      {
        "title": "Install",
        "body": "pip install vibetrading                    # Core\npip install \"vibetrading[hyperliquid]\"     # + Hyperliquid live trading\npip install \"vibetrading[dev]\"             # + pytest, ruff"
      },
      {
        "title": "1. Write a Strategy",
        "body": "import math\nfrom vibetrading import vibe, get_perp_price, get_perp_position, get_perp_summary\nfrom vibetrading import set_leverage, long, reduce_position, get_futures_ohlcv\nfrom vibetrading.indicators import rsi\n\n@vibe(interval=\"1h\")\ndef my_strategy():\n    price = get_perp_price(\"BTC\")\n    if math.isnan(price):\n        return\n\n    position = get_perp_position(\"BTC\")\n    if position and position.get(\"size\", 0) != 0:\n        pnl = (price - position[\"entry_price\"]) / position[\"entry_price\"]\n        if pnl >= 0.03 or pnl <= -0.02:\n            reduce_position(\"BTC\", abs(position[\"size\"]))\n        return\n\n    ohlcv = get_futures_ohlcv(\"BTC\", \"1h\", 20)\n    if ohlcv is None or len(ohlcv) < 15:\n        return\n\n    if rsi(ohlcv[\"close\"]).iloc[-1] < 30:\n        summary = get_perp_summary()\n        margin = summary.get(\"available_margin\", 0)\n        if margin > 100:\n            set_leverage(\"BTC\", 3)\n            qty = (margin * 0.1 * 3) / price\n            if qty * price >= 15:\n                long(\"BTC\", qty, price, order_type=\"market\")"
      },
      {
        "title": "2. Backtest",
        "body": "import vibetrading.backtest\n\nresults = vibetrading.backtest.run(code, interval=\"1h\", slippage_bps=5)\nm = results[\"metrics\"]\n# Keys: total_return, sharpe_ratio, sortino_ratio, calmar_ratio, max_drawdown,\n#        win_rate, profit_factor, expectancy, number_of_trades, cagr, etc."
      },
      {
        "title": "3. Deploy Live",
        "body": "import vibetrading.live\n\nawait vibetrading.live.start(\n    code,\n    exchange=\"hyperliquid\",\n    api_key=\"0xWalletAddress\",\n    api_secret=\"0xPrivateKey\",\n    interval=\"1m\",\n)"
      },
      {
        "title": "Strategy Rules",
        "body": "Every strategy must:\n\nImport and use @vibe or @vibe(interval=\"1h\") decorator\nGuard against math.isnan(price) — prices are NaN before data loads\nCheck position before entering (avoid stacking)\nHave both take-profit and stop-loss exits\nCheck margin > 50 and qty * price >= 15 before trading\n\nOrder types: \"market\" (fills immediately + slippage) or \"limit\" (fills at price)."
      },
      {
        "title": "Sandbox Functions",
        "body": "Data: get_perp_price(asset), get_spot_price(asset), get_futures_ohlcv(asset, interval, limit), get_spot_ohlcv(asset, interval, limit), get_funding_rate(asset), get_open_interest(asset), get_current_time(), get_supported_assets()\n\nAccount: get_perp_summary() → {available_margin, total_margin, ...}, get_perp_position(asset) → {size, entry_price, pnl, leverage} or None, my_spot_balance(asset?), my_futures_balance()\n\nTrading: long(asset, qty, price, order_type=\"market\"), short(asset, qty, price, order_type=\"market\"), buy(asset, qty, price), sell(asset, qty, price), reduce_position(asset, qty), set_leverage(asset, leverage)"
      },
      {
        "title": "Indicators",
        "body": "from vibetrading.indicators import sma, ema, rsi, bbands, atr, macd, stochastic, vwap\n\nAll take pandas Series, return pandas Series. Pure pandas — no dependencies.\n\nFunctionSignatureReturnsrsirsi(close, period=14)Series (0-100)bbandsbbands(close, period=20, std=2.0)(upper, middle, lower)macdmacd(close, fast=12, slow=26, signal=9)(macd_line, signal, histogram)atratr(high, low, close, period=14)Seriesstochasticstochastic(high, low, close, k=14, d=3)(%K, %D)"
      },
      {
        "title": "Position Sizing",
        "body": "from vibetrading.sizing import kelly_size, fixed_fraction_size, volatility_adjusted_size, risk_per_trade_size\n\nkelly_size(win_rate, avg_win, avg_loss, balance, fraction=0.5) — half-Kelly default\nrisk_per_trade_size(balance, risk_pct, stop_distance, price) — risk-based"
      },
      {
        "title": "Templates",
        "body": "from vibetrading.templates import momentum, mean_reversion, grid, dca, multi_momentum\ncode = momentum()  # Returns valid strategy code string"
      },
      {
        "title": "AI Generation",
        "body": "import vibetrading.strategy\n\ncode = vibetrading.strategy.generate(\"BTC RSI oversold entry, 3x leverage\", model=\"claude-sonnet-4-20250514\")\nresult = vibetrading.strategy.validate(code)  # Static analysis\nreport = vibetrading.strategy.analyze(results, strategy_code=code)  # LLM analysis\n\nRequires ANTHROPIC_API_KEY or OPENAI_API_KEY in environment."
      },
      {
        "title": "Comparing Strategies",
        "body": "import vibetrading.compare\n\nresults = vibetrading.compare.run({\"RSI\": code1, \"MACD\": code2}, slippage_bps=5)\nvibetrading.compare.print_table(results)\ndf = vibetrading.compare.to_dataframe(results)"
      },
      {
        "title": "Data Download",
        "body": "import vibetrading.tools\nfrom datetime import datetime, timezone\n\ndata = vibetrading.tools.download_data(\n    [\"BTC\", \"ETH\", \"SOL\"], exchange=\"binance\", interval=\"1h\",\n    start_time=datetime(2025, 1, 1, tzinfo=timezone.utc),\n    end_time=datetime(2025, 6, 1, tzinfo=timezone.utc),\n)\nresults = vibetrading.backtest.run(code, data=data, slippage_bps=5)"
      },
      {
        "title": "Exchange Credentials",
        "body": "Store in .env.local (gitignored):\n\nExchangeapi_keyapi_secretExtraHyperliquidWallet address 0x...Private key 0x...—ParadexStarkNet public keyStarkNet private keyaccount_address=LighterAPI keyAPI secret—AsterAPI keyAPI secretuser_address="
      },
      {
        "title": "Common Patterns",
        "body": "For detailed API docs, strategy patterns, and exchange-specific setup: see references/api-details.md."
      }
    ],
    "body": "vibetrading\n\nAgent-first crypto trading framework. Strategies are Python functions decorated with @vibe that call sandbox functions (get_perp_price, long, short, etc.). Same code runs in backtest and live.\n\nInstall\npip install vibetrading                    # Core\npip install \"vibetrading[hyperliquid]\"     # + Hyperliquid live trading\npip install \"vibetrading[dev]\"             # + pytest, ruff\n\nCore Workflow\n1. Write a Strategy\nimport math\nfrom vibetrading import vibe, get_perp_price, get_perp_position, get_perp_summary\nfrom vibetrading import set_leverage, long, reduce_position, get_futures_ohlcv\nfrom vibetrading.indicators import rsi\n\n@vibe(interval=\"1h\")\ndef my_strategy():\n    price = get_perp_price(\"BTC\")\n    if math.isnan(price):\n        return\n\n    position = get_perp_position(\"BTC\")\n    if position and position.get(\"size\", 0) != 0:\n        pnl = (price - position[\"entry_price\"]) / position[\"entry_price\"]\n        if pnl >= 0.03 or pnl <= -0.02:\n            reduce_position(\"BTC\", abs(position[\"size\"]))\n        return\n\n    ohlcv = get_futures_ohlcv(\"BTC\", \"1h\", 20)\n    if ohlcv is None or len(ohlcv) < 15:\n        return\n\n    if rsi(ohlcv[\"close\"]).iloc[-1] < 30:\n        summary = get_perp_summary()\n        margin = summary.get(\"available_margin\", 0)\n        if margin > 100:\n            set_leverage(\"BTC\", 3)\n            qty = (margin * 0.1 * 3) / price\n            if qty * price >= 15:\n                long(\"BTC\", qty, price, order_type=\"market\")\n\n2. Backtest\nimport vibetrading.backtest\n\nresults = vibetrading.backtest.run(code, interval=\"1h\", slippage_bps=5)\nm = results[\"metrics\"]\n# Keys: total_return, sharpe_ratio, sortino_ratio, calmar_ratio, max_drawdown,\n#        win_rate, profit_factor, expectancy, number_of_trades, cagr, etc.\n\n3. Deploy Live\nimport vibetrading.live\n\nawait vibetrading.live.start(\n    code,\n    exchange=\"hyperliquid\",\n    api_key=\"0xWalletAddress\",\n    api_secret=\"0xPrivateKey\",\n    interval=\"1m\",\n)\n\nStrategy Rules\n\nEvery strategy must:\n\nImport and use @vibe or @vibe(interval=\"1h\") decorator\nGuard against math.isnan(price) — prices are NaN before data loads\nCheck position before entering (avoid stacking)\nHave both take-profit and stop-loss exits\nCheck margin > 50 and qty * price >= 15 before trading\n\nOrder types: \"market\" (fills immediately + slippage) or \"limit\" (fills at price).\n\nSandbox Functions\n\nData: get_perp_price(asset), get_spot_price(asset), get_futures_ohlcv(asset, interval, limit), get_spot_ohlcv(asset, interval, limit), get_funding_rate(asset), get_open_interest(asset), get_current_time(), get_supported_assets()\n\nAccount: get_perp_summary() → {available_margin, total_margin, ...}, get_perp_position(asset) → {size, entry_price, pnl, leverage} or None, my_spot_balance(asset?), my_futures_balance()\n\nTrading: long(asset, qty, price, order_type=\"market\"), short(asset, qty, price, order_type=\"market\"), buy(asset, qty, price), sell(asset, qty, price), reduce_position(asset, qty), set_leverage(asset, leverage)\n\nIndicators\n\nfrom vibetrading.indicators import sma, ema, rsi, bbands, atr, macd, stochastic, vwap\n\nAll take pandas Series, return pandas Series. Pure pandas — no dependencies.\n\nFunction\tSignature\tReturns\nrsi\trsi(close, period=14)\tSeries (0-100)\nbbands\tbbands(close, period=20, std=2.0)\t(upper, middle, lower)\nmacd\tmacd(close, fast=12, slow=26, signal=9)\t(macd_line, signal, histogram)\natr\tatr(high, low, close, period=14)\tSeries\nstochastic\tstochastic(high, low, close, k=14, d=3)\t(%K, %D)\nPosition Sizing\n\nfrom vibetrading.sizing import kelly_size, fixed_fraction_size, volatility_adjusted_size, risk_per_trade_size\n\nkelly_size(win_rate, avg_win, avg_loss, balance, fraction=0.5) — half-Kelly default\nrisk_per_trade_size(balance, risk_pct, stop_distance, price) — risk-based\nTemplates\nfrom vibetrading.templates import momentum, mean_reversion, grid, dca, multi_momentum\ncode = momentum()  # Returns valid strategy code string\n\nAI Generation\nimport vibetrading.strategy\n\ncode = vibetrading.strategy.generate(\"BTC RSI oversold entry, 3x leverage\", model=\"claude-sonnet-4-20250514\")\nresult = vibetrading.strategy.validate(code)  # Static analysis\nreport = vibetrading.strategy.analyze(results, strategy_code=code)  # LLM analysis\n\n\nRequires ANTHROPIC_API_KEY or OPENAI_API_KEY in environment.\n\nComparing Strategies\nimport vibetrading.compare\n\nresults = vibetrading.compare.run({\"RSI\": code1, \"MACD\": code2}, slippage_bps=5)\nvibetrading.compare.print_table(results)\ndf = vibetrading.compare.to_dataframe(results)\n\nData Download\nimport vibetrading.tools\nfrom datetime import datetime, timezone\n\ndata = vibetrading.tools.download_data(\n    [\"BTC\", \"ETH\", \"SOL\"], exchange=\"binance\", interval=\"1h\",\n    start_time=datetime(2025, 1, 1, tzinfo=timezone.utc),\n    end_time=datetime(2025, 6, 1, tzinfo=timezone.utc),\n)\nresults = vibetrading.backtest.run(code, data=data, slippage_bps=5)\n\nExchange Credentials\n\nStore in .env.local (gitignored):\n\nExchange\tapi_key\tapi_secret\tExtra\nHyperliquid\tWallet address 0x...\tPrivate key 0x...\t—\nParadex\tStarkNet public key\tStarkNet private key\taccount_address=\nLighter\tAPI key\tAPI secret\t—\nAster\tAPI key\tAPI secret\tuser_address=\nCommon Patterns\n\nFor detailed API docs, strategy patterns, and exchange-specific setup: see references/api-details.md."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "publisherUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "owner": "crabbytt",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/vibetrading",
    "downloadUrl": "https://openagent3.xyz/downloads/vibetrading",
    "agentUrl": "https://openagent3.xyz/skills/vibetrading/agent",
    "manifestUrl": "https://openagent3.xyz/skills/vibetrading/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/vibetrading/agent.md"
  }
}