Backpack Scalper

SHADOW

WebSocket-based scalping bot for Backpack Exchange. Real-time klines + orderbook signal engine, spike detection for ML training data collection.

Key Numbers

At a Glance

Real-Time OB

Data Source

Spike Signals

Detection

Trading + ML Data

Purpose

Backpack

Exchange

Overview

About This Project

A WebSocket-based scalping system built for Backpack Exchange, a newer crypto venue where structural inefficiencies create short-lived trading opportunities. The bot connects to real-time kline and orderbook streams, computing a suite of signals designed to detect momentum spikes and microstructure anomalies.

Beyond active trading, the system doubles as a sophisticated data collection platform. A spike detection module identifies and logs unusual market events -- sudden volume surges, orderbook imbalances, and price dislocations -- generating labeled training data for downstream ML models.

The modular architecture separates feed ingestion, signal computation, and position management into independent components, making it straightforward to add new signal types or adapt the system to other emerging exchanges with similar WebSocket APIs.

Features

What It Does

WebSocket Feed Engine

Persistent connections to kline and orderbook streams with automatic reconnection, message sequencing, and backpressure handling for reliable real-time data ingestion.

Signal Computation Pipeline

Real-time computation of momentum, volume spike, orderbook imbalance, and microstructure signals from raw feed data with configurable lookback windows.

Spike Detection & ML Logging

Identifies unusual market events -- volume surges, price dislocations, orderbook sweeps -- and logs them as labeled training data for downstream ML model development.

Position Management

Automated position entry, exit, and risk management with configurable stop-loss, take-profit, and maximum exposure parameters.

Architecture

How It Works

$

Challenges

What Made This Hard

Newer exchanges often have thinner liquidity and less predictable microstructure than established venues. Building signals that distinguish genuine momentum from noise in thin orderbooks required careful feature engineering. The system also needed to handle Backpack's specific API behaviors and rate limits while maintaining data collection reliability for ML training purposes.

Stack

Tech Stack

PythonasynciopandasWebSocket