Bitcoin DCA model development and backtesting toolkit
Project description
StackSats
StackSats is a strategy-first backtesting and decision framework for Bitcoin weight management. It separates Strategy intent from validated weight time-series outcomes, providing a strict boundary for causal validation.
Learn more at www.stackingsats.org.
Hosted documentation: https://hypertrial.github.io/stacksats/ — start from docs/index.md.
Documentation map
docs/start/quickstart.md— packaged demodocs/start/system-overview.md— data flow and production pathsdocs/tasks.md— task-first workflowsdocs/commands.md— CLI indexdocs/data-source.md— Bitcoin Research Kit (BRK) dataset support, canonical source data, and manifestsdocs/troubleshooting.md— symptom-based linksdocs/reference/public-api.md— stable1.xlibrary surfacedocs/start/first-strategy-run.md— custom strategy walkthroughdocs/migration.md— breaking-change mappingsdocs/release.md— maintainer releases
BRK compatibility
StackSats is a Python library with explicit compatibility for the Bitcoin Research Kit (BRK) project and BRK-derived canonical data workflows. We document BRK as the upstream project and link to the official BRK surfaces: bitcoinresearchkit/brk, brk on crates.io, and brk on docs.rs.
This is a project and data compatibility statement, not a promise that StackSats embeds BRK, re-exports Rust crates, or version-locks BRK crate APIs. StackSats remains a Python package with its own stable 1.x support boundary.
Framework principles
The framework owns budget math, iteration, feasibility clipping, and lock semantics; you own features, signals, hyperparameters, and daily intent (propose_weight or build_target_profile). The same sealed allocation kernel runs in local runs, backtests, and production. See docs/framework.md.
Primary production flow
- StackSats computes a validated BTC accumulation decision.
- An external agent or automation reads the decision payload.
- Brokerage execution stays outside StackSats.
Use stacksats strategy decide-daily (or strategy.decide_daily(...)) for the agent-facing interface; docs/run/decide-daily.md covers payloads and sensitivity. Use stacksats serve agent-api for a hosted /v1 HTTP service (docs/run/agent-api.md, including token policy). Use stacksats strategy run-daily when StackSats should submit through a configured adapter (docs/run/run-daily.md).
Security: follow SECURITY.md for reporting; treat decision and API tokens as secrets.
Installation
| Use case | Command |
|---|---|
| Use StackSats from PyPI | pip install stacksats |
| Editable install from a checkout | python -m pip install -c requirements/constraints-maintainer.txt -e ".[dev,all]" |
Optional extras: pip install "stacksats[viz]" (animation/plots), [network] (HTTP BTC price helpers), [service] (agent API), [deploy] (Postgres/export helpers). The stacksats-plot-weights helper needs both [viz] and [deploy] plus a configured DATABASE_URL (it reads stored weight windows, then renders). Helper scripts are documented convenience tools, not part of the frozen stable 1.x CLI subset.
Development venv (from repo root):
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install -c requirements/constraints-maintainer.txt -e ".[dev,all]"
pip install pre-commit
venv/bin/python -m pre_commit install -t pre-commit
Quick start
stacksats demo backtest
Artifacts: output/<strategy_id>/<version>/<run_id>/
Next: docs/commands.md for the full CLI, docs/start/full-data-setup.md for BRK data (stacksats data fetch|prepare|doctor), docs/start/eda-quickstart.md for EDA, docs/stability.md for the support boundary. stacksats strategy validate is strict by default; use --no-strict only when you intend the lighter path.
Public API
The stable 1.x contract covers top-level exports, documented artifacts, and the documented CLI/agent API subset. See docs/reference/public-api.md and docs/stability.md. load_data() uses strict BRK validation; for long-format merged metrics exploration, see docs/start/eda-quickstart.md.
Development
See CONTRIBUTING.md for the full local quality matrix (tests, docs gates, coverage, release checks). Typical fast loop:
venv/bin/python -m pytest -q
venv/bin/python -m ruff check .
bash scripts/check_docs_refs.sh
venv/bin/python scripts/check_docs_ux.py
venv/bin/python -m mkdocs build --strict
If the repo path changes locally, rerun bash scripts/install_hooks.sh to refresh git hook paths.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stacksats-1.2.2.tar.gz.
File metadata
- Download URL: stacksats-1.2.2.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7afc98f1300fba072a78fed93ad16a014146b2dcaa97b81c5a2c51f6eff02df4
|
|
| MD5 |
a11ee8c9e41c98fb5a2fcad34d052658
|
|
| BLAKE2b-256 |
4b7cb6669647d03f4e5ff79818d9aa4af00ed124f0b82a309373d21cc2b7a73c
|
File details
Details for the file stacksats-1.2.2-py3-none-any.whl.
File metadata
- Download URL: stacksats-1.2.2-py3-none-any.whl
- Upload date:
- Size: 876.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb387dcd68c0a9ff3964413cd0def918ff4da6e8f8a028ece33dfc2eaa78152
|
|
| MD5 |
821542c0a56bfe6227fd4b1baa77b97e
|
|
| BLAKE2b-256 |
1b60cb0cf15b24a6ea2787e70fd0bc973a130be84947f05bf658704a4318aad7
|