Lighter HFT

LIVE

High-frequency trading on commodity futures. Rust microstructure engine, sub-5ms features, XGBoost GPU, 33 models across WTI/HYPE/DOGE/XAG/XAU.

Key Numbers

At a Glance

<5ms

Feature Latency

33

Trained Models

5

Instruments

30x

GPU Speedup

Overview

About This Project

A high-frequency trading system purpose-built for commodity and crypto futures on decentralized exchanges. The system's heartbeat is a Rust microstructure engine that computes tick-by-tick features in under 5ms -- fast enough to capture fleeting dislocations in WTI crude oil, gold, silver, HYPE, and DOGE perpetual futures.

Training leverages GPU-accelerated XGBoost with Optuna hyperparameter optimization, achieving a 30x speedup over CPU training. This enables rapid iteration: 33 symbol-specific models are trained, evaluated, and promoted through an automated sweep pipeline that tests hundreds of configurations per instrument.

The system uses a custom sweep regression objective that targets directional price movements rather than binary classification. This approach consistently outperforms standard AUC-based objectives, producing models that better capture the magnitude and direction of short-horizon price moves.

Features

What It Does

Rust Microstructure Engine

All critical-path feature computation in Rust with PyO3 bindings. Achieves consistent sub-3ms latency for full feature vector generation from raw tick data.

Tick-by-Tick Feature Pipeline

Temporal feature aggregation across multiple time horizons captures microstructure dynamics -- trade imbalance, spread behavior, and quote intensity at tick resolution.

XGBoost GPU Training with Optuna

GPU-accelerated model training with automated hyperparameter sweeps. 30x speedup enables exploration of hundreds of configurations per instrument overnight.

Sweep Regression Objective

Custom regression loss targeting directional price sweeps rather than binary up/down classification. Consistently outperforms AUC-based alternatives in live validation.

Stochastic Decision Thresholds

Adaptive confidence thresholds that account for regime-dependent signal quality, preventing over-trading in low-conviction environments.

Architecture

How It Works

$

Challenges

What Made This Hard

Decentralized exchange orderbooks have fundamentally different microstructure than centralized venues -- no hidden liquidity, deterministic matching, and gas or fee considerations that shift optimal strategies. Adapting HFT signals originally designed for CEX environments required rethinking which features actually carry predictive alpha in a fully transparent orderbook. The latency-accuracy tradeoff in feature computation pushed the system toward Rust for anything on the critical path.

Stack

Tech Stack

RustXGBoostPyO3GPU