Skip to main content

tickvault

Full-depth crypto order book archives, honest about their own gaps.

There is no good free source of full-depth crypto order book history. Everything free is top-of-book, resampled to bars, or carries undocumented gaps that quietly poison a backtest. This reads the archives produced by tickvault, which publish their gap statistics on the front page.

pip install tickvault-ob

tickvault-ob on PyPI, tickvault when you import it. The plain name normalises to tick-vault under PEP 503, and that belongs to an unrelated Dukascopy tick downloader, so the distribution carries a suffix and the import does not.

Not published yet. Until the first release tag, build it from a checkout of the repository with cd bindings && maturin develop --release.

Ten lines to a plot

import tickvault

archive = tickvault.open("./archive")
bars = archive.bars("kraken", "BTC-USD", bar_seconds=60, frame="polars")
print(bars.select("start", "open", "high", "low", "close", "volume"))

start, end = archive.span_ns("kraken", "BTC-USD")
book = archive.book_at("kraken", "BTC-USD", end)
print(book.mid, book.spread, book.imbalance(depth=10))

archive.plot_book("kraken", "BTC-USD", end, show=True)

Nine lines, and no date to look up first. A test runs exactly this block against a real archive on every commit, so it cannot rot into an example that no longer works.

Two things to know

None means the data cannot answer, and never zero.

>>> bars["volume"][0] is None
True

An aggregated feed shows a price level shrinking and never says whether it traded or was cancelled, so the traded volume of a Kraken or Coinbase bar is not something the data contains. Zero would claim nothing traded. Only an order-by-order feed reports executions, and only Bitstamp offers one without an API key, so volume is a real number there and None on the other five.

Same rule elsewhere: a one-sided book has no mid, and an empty one has no imbalance.

Suspect data is labelled, not hidden.

book = archive.book_at("kraken", "BTC-USD", when)
if book.suspect:
    print(book.origin, book.suspect_rows)   # why, and how much

Every Tick carries suspect too, and plot_book writes it on the chart. The recorder knows which stretches of time it could not vouch for; this hands that through rather than quietly averaging over it.

Replaying

for tick in archive.replay("kraken", "BTC-USD"):
    if tick.mid is not None:
        strategy.on_book(tick.at_ns, tick.bid, tick.ask)

speed=0 is as fast as the archive reads, which is what a backtest wants. speed=1 preserves the recorded gaps, so a burst that arrived in one millisecond is delivered as one millisecond of work. That is the difference between testing whether a strategy works and whether it can keep up.

Exact numbers

The float properties above are conveniences. The archive holds prices as exact integers counting 1e-9 units, and that is what you get from Arrow:

batch = book.to_arrow()          # price and qty are int64, nothing rounded
price = batch["price"][0].as_py() / 10**9

Bars are floats: a bar's mid is already a truncated midpoint, so exactness has run out by then.

What the venues can prove

>>> for v in tickvault.capabilities():
...     print(v["venue"], v["detects_loss"], v["validation"])
coinbase True Counter { step: 1, restart_floor: 0 }
kraken True Checksum { depth: 10 }
okx True Chained
bybit True Counter { step: 1, restart_floor: 1 }
binance-us True UpdateIdRange
bitstamp False MonotonicTimestamp

Bitstamp's aggregated feed carries no sequence number, update id or checksum, so a lost message on it is undetectable by any means. It says so rather than reporting itself as clean. Its order-by-order feed chains every event, and recording it that way makes it the best validated of the six.

Each entry also carries blind_spots: the things that venue cannot see, in plain terms.

Licence

MIT or Apache-2.0, at your option.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tickvault_ob-0.1.1.tar.gz (453.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tickvault_ob-0.1.1-cp39-abi3-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

tickvault_ob-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

tickvault_ob-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tickvault_ob-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file tickvault_ob-0.1.1.tar.gz.

File metadata

  • Download URL: tickvault_ob-0.1.1.tar.gz
  • Upload date:
  • Size: 453.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tickvault_ob-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6a9d580bbbdd816a197fa5b6222d8634eb71d9cfe891e72b83265d3e0bb0846e
MD5 93e4833e1e56c32cb2a3a0c8e00f9736
BLAKE2b-256 51d723c01b3d83e81cce3e2fb8b446a48864836e788d0229361c72c24a696455

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.1.tar.gz:

Publisher: release.yml on lgoyal6/tickvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tickvault_ob-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: tickvault_ob-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tickvault_ob-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 28164b9f6f0d554026923b8ed7a1b839758eaafe0cf3e1db6716b0107fce9869
MD5 d201f993cc3a71fb143889277b76b70d
BLAKE2b-256 803e709cea06b187b3ea3b085087e4e030cb4d0f33d4eafcc5e3d1bcc191f0e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.1-cp39-abi3-win_amd64.whl:

Publisher: release.yml on lgoyal6/tickvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tickvault_ob-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 565a9e2b62349f43eeafc933a4c0f58574c5ef29ad877ea7b52381640fd6328e
MD5 9b6e96c2557866f08c9f403ea60ed49a
BLAKE2b-256 b40b8ed40fe313423a910d3e68cbc7eb42ac377763c3001dbb62a9311e6c222c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on lgoyal6/tickvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tickvault_ob-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 721d9cd5ec528d94be070c2066e85cb9eb3f0eca438d723643589f6fa0a64dd1
MD5 6099070c36e71a1a94d6fb4cc5f458f7
BLAKE2b-256 b751eb4daf9f491956222410ca06db251a6a560632fbdca4ae7e84dd63983ee4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on lgoyal6/tickvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tickvault_ob-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 764b873e9ae7128420f316b8a9e2eb66eb1bdef4b1e39e7911131b5446ecdb27
MD5 5562e8cabf83e59a42d1e3c4eba43bb2
BLAKE2b-256 fd68037710e9d403f19b342953c8f16c71eaa1c8ff8d6e3fdaca43c158dafa57

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on lgoyal6/tickvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

5 files

0.1.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page