a marketmaker.cc project

Vector Arbitrage

Arbitrage is decided by the depth you can fill, not by the last price on the screen.

A price gap is a number on two screens. It becomes a trade only when the book on each side can absorb our size.

01 / depth walk

A price gap is not a trade until the depth fills it.

Two venues, two books. We match the ask on one venue against the bid on the other, level by level, and charge fees on both legs. The size that still fills after costs is the signal.

0levels consumed
0.0net edge, bps
yesfully fillable

Synthetic books for illustration, not market data. Fee assumed at 5 bps per leg. Real fees, funding and closing cost are set in the config.

02 / pipeline

From two books to one signal.

01

Collect

Snapshot and delta streams of Binance and Bybit, spot and USDT perpetual, for BTCUSDT and ETHUSDT. Public data only.

02

Validate

A book is tradable only after its sequence checks pass. Gaps, resets, malformed levels and stale books invalidate it until it resyncs.

03

Walk the depth

Match asks on one venue with bids on the other, level by level, after fees, funding and closing cost. The size that still fills is the signal.

04

Archive and replay

Every ordered event goes into a checksummed archive. Replay runs the same engine over the same events, with no exchange connection.

03 / status

Replay works. Live orders are three gates away.

The collector and the replay run today. Order adapters, testnet reconciliation and an out-of-sample L2 backtest are not finished, and no profitability result has been validated.

  1. Collectdone
  2. Replaydone
  3. Paperlibrary only
  4. Testnetpending
  5. Livenot enabled

04 / run it locally

Three commands. No API keys.

Collect records public books, archive-check verifies every segment, replay recomputes the signals from the archive. The example config has zero balances, so it records books and emits no trade signals.

# record public books into a new archive
cargo run --release -p vector-arb -- collect \
  --config config.example.json \
  --archive-dir ./archives/session-001

# verify every segment
cargo run --release -p vector-arb -- archive-check \
  --archive-dir ./archives/session-001

# recompute signals from the archive
cargo run --release -p vector-arb -- replay \
  --config config.example.json \
  --archive-dir ./archives/session-001

05 / limits

What a signal is not.

Not a fill

Replay does not model queue position, order acknowledgments or partial fills.

Not a latency test

Network and order latency are not simulated yet.

Not a balance

Funding settlement and balance changes are not simulated.

Not a result

There is no validated out-of-sample P&L. Repeated signals are observations, not realized profit.