Kamakura Quant Lab

鎌倉クオンツラボ 日本語

Tools

Two command-line tools. Komachi fetches the data; Hase turns it into the derived datasets analysis actually runs on. Both are Python packages under Apache License 2.0.

ToolDoesPyPI
KomachiFetch: download, import external sources, check fileskamakuraquantlab-komachi
HaseAnalyse: derive silver and gold, plotkamakuraquantlab-hase

Tested on Linux and macOS, Python 3.13 or later. Not tested on Windows, and not on Python 3.12 or earlier. They may well work, but we have no environment to check on, so those are outside what we support.

Hase: 1. What it does

Turns the bronze you hold into datasets analysis can use, written beside it under the same root in the same layout.

DatasetLayerWhat it is
BookStatesilverBest bid and ask per snapshot, with mid, spread and the depth at the touch
MarketPricesilverWhat a given trade size would actually pay, by walking the book
SpreadgoldThe spread's moving average on a one-second grid, in bps
VolatilitygoldRealized volatility and the volatility of returns on a one-second grid, in bps

Hase reads local files only. It reaches no API, holds no token, and spends no allowance. Point it at any bronze tree you have and it behaves the same.

Hase: 2. Install and derive

pip install kamakuraquantlab-hase

hase derive BookState   --market COINCHECK:BTC_SPOT --start 2025-07-01 --end 2025-07-28
hase derive MarketPrice --market COINCHECK:BTC_SPOT --start 2025-07-01 --end 2025-07-28
hase derive Spread      --market COINCHECK:BTC_SPOT --start 2025-07-01 --end 2025-07-28
hase derive Volatility  --market COINCHECK:BTC_SPOT --start 2025-07-01 --end 2025-07-28

hase local --market COINCHECK:BTC_SPOT

A day already derived is left alone; pass --recreate to rebuild it. hase local lists the bronze you hold and the derived data beside it.

If you install Hase first, it asks the same question Komachi does and writes the same ~/.kamakuraquantlab.env, so whichever tool you reach for first is the only one that asks. Hase reads only the data root from that file, never the token.

MarketPrice takes its size in base currency, 0.002 BTC by default (--execution-size). To walk to a cash amount instead, --execution-notional 1000000. The size is part of the output path, so two of them never overwrite each other.

Hase: 3. Plot it

hase plot-book   --market COINCHECK:BTC_SPOT --date 2025-07-01 --output book.png
hase plot-trades --market COINCHECK:BTC_SPOT --date 2025-07-01 --output trades.png

plot-book draws best bid and ask with the spread beneath; plot-trades draws price with buy and sell volume. Axes are labelled in JST, matching the day the file was cut in.

Source and documentation

Both are published under Apache License 2.0, so you can read exactly what they do with your token and your machine before running them.

Komachi, Hase. If something does not work, get in touch.