{
  "schemaVersion": "1.0",
  "item": {
    "slug": "bybit-order-book",
    "name": "bybit-order-book",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/davidm413/bybit-order-book",
    "canonicalUrl": "https://clawhub.ai/davidm413/bybit-order-book",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/bybit-order-book",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=bybit-order-book",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "backtest.py",
      "bybit_data_format.md",
      "download_orderbook.py",
      "process_orderbook.py",
      "SKILL.md",
      "strategies.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-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/bybit-order-book"
    },
    "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/bybit-order-book",
    "agentPageUrl": "https://openagent3.xyz/skills/bybit-order-book/agent",
    "manifestUrl": "https://openagent3.xyz/skills/bybit-order-book/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/bybit-order-book/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": "ByBit Order Book Backtester",
        "body": "End-to-end pipeline: download → process → backtest → report."
      },
      {
        "title": "Dependencies",
        "body": "pip install undetected-chromedriver selenium pandas numpy pyarrow --break-system-packages\n\nChrome/Chromium must be installed for Selenium."
      },
      {
        "title": "Workflow",
        "body": "The pipeline has 3 stages. Run them sequentially, or skip to later stages if data is already available."
      },
      {
        "title": "Stage 1: Download Order Book Data",
        "body": "Prompt the user for:\n\nSymbol (default: BTCUSDT)\nDate range (default: last 30 days)\n\nRun scripts/download_orderbook.py:\n\npython scripts/download_orderbook.py \\\n  --symbol BTCUSDT \\\n  --start 2024-06-01 --end 2024-06-30 \\\n  --output ./data/raw\n\nKey details:\n\nDownloads from https://www.bybit.com/derivatives/en/history-data\nAutomatically chunks into 7-day windows (ByBit's limit)\nUses undetected-chromedriver for Cloudflare bypass\nOutputs: ZIP files in ./data/raw/ named {date}_{symbol}_ob500.data.zip\nFor data format details: see references/bybit_data_format.md\n\nIf Selenium fails (Cloudflare blocks, UI changes): Instruct the user to manually download from the ByBit page and place ZIPs in ./data/raw/."
      },
      {
        "title": "Stage 2: Process & Filter to Depth 50",
        "body": "Run scripts/process_orderbook.py:\n\npython scripts/process_orderbook.py \\\n  --input ./data/raw \\\n  --output ./data/processed \\\n  --depth 50 \\\n  --sample-interval 1s\n\nWhat it does:\n\nReads JSONL from ZIPs (each line = full 500-level L2 snapshot)\nFilters to top 50 bid/ask levels\nComputes derived features: mid_price, spread, volume_imbalance, microprice\nOptionally downsamples (e.g., 1s, 5s, 1min) — recommended for faster backtests\nOutputs: Parquet files in ./data/processed/\n\nWithout downsampling: ~860K snapshots/day, ~300 MB Parquet per day per symbol.\nWith 1s downsampling: ~86K snapshots/day, ~5 MB per day — much more practical."
      },
      {
        "title": "Stage 3: Backtest Strategies",
        "body": "Run scripts/backtest.py:\n\n# Run all 10 strategies\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --output ./reports\n\n# Run specific strategies\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --strategies imbalance,breakout,market_making \\\n  --output ./reports\n\n# Quick test with limited rows\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --max-rows 100000 \\\n  --output ./reports\n\nStrategy keys: imbalance, breakout, false_breakout, scalping, momentum, reversal, spoofing, optimal_execution, market_making, latency_arb\n\nOutputs in ./reports/:\n\n{SYMBOL}_backtest_report.json — Full results with equity curves\n{SYMBOL}_backtest_report.md — Comparison table and detailed metrics\n\nReport metrics per strategy: total trades, winners/losers, win rate, cumulative PnL, Sharpe ratio, max drawdown (absolute and %), avg PnL per trade, avg hold time, profit factor, best/worst trade, equity curve.\n\nFor strategy logic and tunable parameters: see references/strategies.md"
      },
      {
        "title": "Customization",
        "body": "To modify strategy parameters, edit the __init__ method of any strategy class in scripts/backtest.py. Each strategy's self.params dict contains all tunables.\n\nTo add a new strategy:\n\nSubclass Strategy in scripts/backtest.py\nImplement on_snapshot(self, row, idx, df) with entry/exit logic\nRegister in STRATEGY_MAP"
      },
      {
        "title": "Troubleshooting",
        "body": "Selenium can't load ByBit page: ByBit uses Cloudflare. Ensure undetected-chromedriver is up to date. Try --no-headless to debug visually. Fall back to manual download.\n\nOut of memory on processing: Use --sample-interval 1s or larger. Process one day at a time.\n\nNo trades generated: Strategy thresholds may be too tight for the data period. Relax parameters (lower thresholds, shorter lookbacks) in references/strategies.md."
      }
    ],
    "body": "ByBit Order Book Backtester\n\nEnd-to-end pipeline: download → process → backtest → report.\n\nDependencies\npip install undetected-chromedriver selenium pandas numpy pyarrow --break-system-packages\n\n\nChrome/Chromium must be installed for Selenium.\n\nWorkflow\n\nThe pipeline has 3 stages. Run them sequentially, or skip to later stages if data is already available.\n\nStage 1: Download Order Book Data\n\nPrompt the user for:\n\nSymbol (default: BTCUSDT)\nDate range (default: last 30 days)\n\nRun scripts/download_orderbook.py:\n\npython scripts/download_orderbook.py \\\n  --symbol BTCUSDT \\\n  --start 2024-06-01 --end 2024-06-30 \\\n  --output ./data/raw\n\n\nKey details:\n\nDownloads from https://www.bybit.com/derivatives/en/history-data\nAutomatically chunks into 7-day windows (ByBit's limit)\nUses undetected-chromedriver for Cloudflare bypass\nOutputs: ZIP files in ./data/raw/ named {date}_{symbol}_ob500.data.zip\nFor data format details: see references/bybit_data_format.md\n\nIf Selenium fails (Cloudflare blocks, UI changes): Instruct the user to manually download from the ByBit page and place ZIPs in ./data/raw/.\n\nStage 2: Process & Filter to Depth 50\n\nRun scripts/process_orderbook.py:\n\npython scripts/process_orderbook.py \\\n  --input ./data/raw \\\n  --output ./data/processed \\\n  --depth 50 \\\n  --sample-interval 1s\n\n\nWhat it does:\n\nReads JSONL from ZIPs (each line = full 500-level L2 snapshot)\nFilters to top 50 bid/ask levels\nComputes derived features: mid_price, spread, volume_imbalance, microprice\nOptionally downsamples (e.g., 1s, 5s, 1min) — recommended for faster backtests\nOutputs: Parquet files in ./data/processed/\n\nWithout downsampling: ~860K snapshots/day, ~300 MB Parquet per day per symbol. With 1s downsampling: ~86K snapshots/day, ~5 MB per day — much more practical.\n\nStage 3: Backtest Strategies\n\nRun scripts/backtest.py:\n\n# Run all 10 strategies\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --output ./reports\n\n# Run specific strategies\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --strategies imbalance,breakout,market_making \\\n  --output ./reports\n\n# Quick test with limited rows\npython scripts/backtest.py \\\n  --input ./data/processed/BTCUSDT_ob50.parquet \\\n  --max-rows 100000 \\\n  --output ./reports\n\n\nStrategy keys: imbalance, breakout, false_breakout, scalping, momentum, reversal, spoofing, optimal_execution, market_making, latency_arb\n\nOutputs in ./reports/:\n\n{SYMBOL}_backtest_report.json — Full results with equity curves\n{SYMBOL}_backtest_report.md — Comparison table and detailed metrics\n\nReport metrics per strategy: total trades, winners/losers, win rate, cumulative PnL, Sharpe ratio, max drawdown (absolute and %), avg PnL per trade, avg hold time, profit factor, best/worst trade, equity curve.\n\nFor strategy logic and tunable parameters: see references/strategies.md\n\nCustomization\n\nTo modify strategy parameters, edit the __init__ method of any strategy class in scripts/backtest.py. Each strategy's self.params dict contains all tunables.\n\nTo add a new strategy:\n\nSubclass Strategy in scripts/backtest.py\nImplement on_snapshot(self, row, idx, df) with entry/exit logic\nRegister in STRATEGY_MAP\nTroubleshooting\n\nSelenium can't load ByBit page: ByBit uses Cloudflare. Ensure undetected-chromedriver is up to date. Try --no-headless to debug visually. Fall back to manual download.\n\nOut of memory on processing: Use --sample-interval 1s or larger. Process one day at a time.\n\nNo trades generated: Strategy thresholds may be too tight for the data period. Relax parameters (lower thresholds, shorter lookbacks) in references/strategies.md."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/davidm413/bybit-order-book",
    "publisherUrl": "https://clawhub.ai/davidm413/bybit-order-book",
    "owner": "davidm413",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/bybit-order-book",
    "downloadUrl": "https://openagent3.xyz/downloads/bybit-order-book",
    "agentUrl": "https://openagent3.xyz/skills/bybit-order-book/agent",
    "manifestUrl": "https://openagent3.xyz/skills/bybit-order-book/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/bybit-order-book/agent.md"
  }
}