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.0.tar.gz (4.0 MB 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.0-cp39-abi3-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

tickvault_ob-0.1.0-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.0-cp39-abi3-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tickvault_ob-0.1.0-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.0.tar.gz.

File metadata

  • Download URL: tickvault_ob-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • 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.0.tar.gz
Algorithm Hash digest
SHA256 14c814ed1c3a8c0af6f3a82a64bccdbcd2ef1f89e57e95308a6bae247b4dd1ce
MD5 bb8339660896ba29e46323a246385a1f
BLAKE2b-256 13ba771bc0f3872b460b20029a50f6105d8ee06879333db696524cb9d5ec963e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.0.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.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: tickvault_ob-0.1.0-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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 173b457b9e87eb0b35bf6017b75b32d3d21e468a66304ebb37ef50c50cdce997
MD5 b6a10bf663f6c6074fb34d057bc935d2
BLAKE2b-256 ca5f198930305f4e97c3cc1c5619e8092a1e4f55f0cccf2a27d211749901d387

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.0-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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39de187bf1d19e8f33eb1df67bd72c89d985aadb5822c68994e704899d2825c5
MD5 76560a679055c4fba2b3028897fcd5f4
BLAKE2b-256 c2ead3d75fee43ff5c23e64fb78abbfb4de653c9ee0d41319b4e407f89ea6bcd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.0-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.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c89643f8a147d926bb71e1f489172473682eeb586ed3a87a6b25d62f074b9e61
MD5 8ef51cebd79ba761ccbd482a6bf59607
BLAKE2b-256 6f01d792c7f79c27edddf857b40f967f4d0442aad8e4abbe34b66f17dc1ec0ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.0-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.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tickvault_ob-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a5395e73728b2e8778fd54a91ec5e6e514b41a80253d81ff2195efae382c8db5
MD5 9dcfd94ac11c4825d7f0402ba9e7af0a
BLAKE2b-256 bbcf452651d0a883c4b7262ac21edaa06e532582a4506e279b020b0fd197a315

See more details on using hashes here.

Provenance

The following attestation bundles were made for tickvault_ob-0.1.0-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

0.1.1

5 files

This release

0.1.0 This release

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