l2capture

command
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Command l2capture polls a public exchange's live level-2 order book and computes order-flow imbalance (OFI) and book imbalance in real time using pkg/signals — the same code the simulator study uses, now on real market data.

It closes the loop on the research question (docs/research-roadmap.md §1): does OFI track price *contemporaneously* on live data too? At the end it regresses mid-price change on OFI over the captured window and prints the R².

Live decimal prices/sizes are converted to the engine's integer ticks/lots at the Instrument boundary (BTC-USD: 0.01 tick, 1e-8 lot); everything downstream is exact integer arithmetic.

go run ./cmd/l2capture                 # BTC-USD, 20 polls, 1s apart
go run ./cmd/l2capture -polls 60 -product ETH-USD

Data: Coinbase public REST (no key). Educational; not trading infrastructure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL