ByBit Order Book Backtester for Openclaw

A comprehensive end-to-end pipeline for downloading ByBit L2 order book data and simulating high-frequency trading strategies.

davidm413
v1.0.0
Feb 8, 2026
2
2.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bybit-order-book

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bybit-order-book using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is ByBit Order Book Backtester?

The ByBit Order Book Backtester is a professional-grade tool designed for quantitative traders to bridge the gap between raw exchange data and actionable strategy insights. As part of the Openclaw Skills ecosystem, it automates the complex process of scraping historical ob500 snapshots from ByBit derivatives, bypassing Cloudflare protections, and transforming massive JSONL datasets into optimized Parquet files for rapid analysis.

This skill empowers developers to test sophisticated hypotheses such as order book imbalance, spoofing detection, and market-making logic against real-world historical depth. By providing a structured workflow from data acquisition to performance reporting, it eliminates the infrastructure overhead usually associated with high-frequency data engineering.

ByBit Order Book Backtester Use Cases

  • Automating the retrieval of historical L2 order book data for specific crypto symbols like BTCUSDT.
  • Filtering 500-level depth data down to the top 50 levels to reduce noise and computational load.
  • Benchmarking 10 different trading strategies, including Scalping and Latency Arbitrage, on the same historical dataset.
  • Generating detailed equity curves and risk metrics like Sharpe ratio and Max Drawdown for quantitative research.
  • Downsampling tick-level data to 1-second intervals to speed up the strategy iteration cycle.

How ByBit Order Book Backtester Works

  1. The skill utilizes Selenium and undetected-chromedriver to navigate the ByBit history-data portal and download compressed ob500 order book files.
  2. Raw data is processed by unzipping JSONL files and filtering them to the top 50 bid/ask levels while calculating derived features like microprice and volume imbalance.
  3. The processed data is saved as a Parquet file, which can be downsampled (e.g., to 1s intervals) to optimize backtesting performance.
  4. Users select from a suite of 10 built-in strategies to run against the processed historical data.
  5. The engine simulates trades and generates a comprehensive performance report in both JSON and Markdown formats for easy review.

ByBit Order Book Backtester Setup

To use these Openclaw Skills, ensure you have Chrome or Chromium installed, then install the Python dependencies:

pip install undetected-chromedriver selenium pandas numpy pyarrow --break-system-packages

Initialize the data download by specifying your target symbol and date range:

python scripts/download_orderbook.py --symbol BTCUSDT --start 2024-06-01 --end 2024-06-15 --output ./data/raw

ByBit Order Book Backtester Data Schema & Taxonomy

The skill manages data across three distinct directories to ensure a clean research pipeline:

Location Format Description
/data/raw/ ZIP / JSONL Raw 500-level snapshots exactly as provided by ByBit.
/data/processed/ Parquet Filtered depth-50 data with features like spread and mid-price.
/reports/ MD / JSON Backtest results including win rates, PnL, and strategy comparisons.

Each snapshot in the processed data includes timestamps, top 50 bids/asks, and pre-calculated liquidity metrics.

ByBit Order Book Backtester Advanced Features

  • Cloudflare-aware automation for reliable data harvesting from protected exchange endpoints.
  • Support for 10 modular strategy types including Momentum, Reversal, and False Breakout.
  • High-performance data processing capable of handling 860K+ snapshots per day.
  • Extensible strategy framework allowing developers to inject custom entry/exit logic by subclassing the base engine.
  • Detailed performance analytics providing profit factor, average hold time, and absolute/percentage drawdown metrics.
  • Automated data chunking to handle ByBit's 7-day download window restrictions.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*