Skip to main content

Spirit

PyPI Python License Downloads

Spirit is a programmable Python platform for algorithmic cryptocurrency trading — a playground for building and testing your own strategies. It runs on your own hardware, talks to exchanges directly, and you own the strategy logic end-to-end.

The framework is open source under Apache-2.0. Spirit handles the orchestration: market data, order placement, lifecycle hooks, and crash recovery. As your strategies mature, Plus and Pro open up access to our custom technical indicators and cloud storage for backtesting.


Quick start

On Ubuntu / Debian (and most modern Linux):

sudo apt install -y pipx
pipx ensurepath
pipx install spirit-platform

Then open a new shell and run:

python3 -m spirit.setup     # interactive setup wizard
spirit --mode paper         # start paper trading

Other install paths (venv, etc.) and troubleshooting: see INSTALL.md.

Run the wizard once (it asks your tier, instance name, and an optional Kraken API key for live trading), pick one of the bundled examples (sma_crossover or macd_demo) or drop your own file in ~/.spirit/strategies/, and Spirit starts paper-trading.

To go live, swap --mode paper for --mode live once you've sanity-checked the paper P&L.

OHLC data ownership (v2.2.4+). Spirit's local OHLC store is yours — Free instances persist candles in ~/.spirit/<instance>/spirit.db. When Spirit starts up after downtime, it fills the gap (up to 12 hours of 1-minute candles per boot) from the exchange automatically. For longer gaps, run python3 -m spirit.backfill <kraken-csv> once with a Kraken CSV export. The boot catch-up adds ~15–20 seconds for a typical multi-pair multi-interval config; configure with SPIRIT_OHLC_CATCHUP_INTERVALS (default 60).


Tiers and pricing

See www.tradebot.live/pricing for tier details, pricing, and what each level adds.


Writing a strategy

Strategies subclass BaseStrategy and implement evaluate_trade(). Everything else is optional; opt into lifecycle hooks as you need them.

from spirit.strategies.base import BaseStrategy

class MyStrategy(BaseStrategy):
    def evaluate_trade(self, pair: str, mode: str = "test", **kwargs):
        # Return {"entry": bool, "exit": bool, "details": {...}}
        return {"entry": False, "exit": False, "details": {}}

Optional hooks the orchestrator will call when configured: on_monitoring_tick, on_entry_confirmed, on_exit_completed, validate_readiness, get_data_requirements. Properties for tier-aware behaviour: uses_risk_gate, required_capabilities. See the bundled examples; both files are heavily commented teaching artifacts:

Drop your own under ~/.spirit/strategies/ and Spirit picks it up at next startup.

For more information visit www.tradebot.live.


Project structure

src/spirit/
  main.py                  - entrypoint
  setup.py                 - first-run wizard
  config.py                - .env / yaml loader
  trade_signal.py          - signal dataclass
  trade_status.py          - status dataclass
  trade_types.py           - TradeRecord dataclass (used by strategies)
  exchange/                - exchange adapter protocol + Kraken impl
  pipeline/                - WebSocket event bus, freshness cache, daemon health
  storage/                 - local SQLite schema (Free tier)
  strategies/
    base.py                - BaseStrategy abstract base class
    examples/sma_crossover - minimal reference strategy
    examples/macd_demo     - full-lifecycle reference strategy
  utils/                   - data providers, OHLC buffer, paper executor, etc.

The framework runs any strategy you write against any data source you plug in. Plus and Pro plans add bundled indicators served via the gateway API — the D-Limit suite, V3 confidence scorer, and risk-gate calibrators — without changing the framework you're building against. See tradebot.live for what each tier unlocks.


Supported exchanges

Spirit includes a Kraken adapter by default. You can write your own by implementing the ExchangeProvider protocol in src/spirit/exchange/protocol.py — see docs/reference/EXCHANGE_PLUGIN_GUIDE.md for the full guide.

We'll be releasing more exchange adapters over time. If there's a specific exchange you'd like us to prioritise, open a GitHub issue and we'll see if we can fit it in.


Status

Current release: see the latest tag on PyPI or GitHub Releases for the changelog. The Apache-2.0 framework is stable; Plus and Pro infrastructure is in active development.


License

Apache-2.0. See LICENSE.

The framework is free to use, modify, and redistribute. Plus and Pro subscriptions cover the hosted data and indicator infrastructure; the framework code itself doesn't depend on a subscription to run.


Support

Metadata

Release files for spirit-platform 2.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spirit-platform 2.2.5
File Size Uploaded
spirit_platform-2.2.5.tar.gz 216.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spirit-platform 2.2.5
File Interpreter ABI Platform
spirit_platform-2.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 463.5 kB

Release files / spirit_platform-2.2.5.tar.gz

Download URL spirit_platform-2.2.5.tar.gz
Size 216.8 kB
Tags Source
SHA-256 checksum
How to use checksums
39e404ce4c0bcaff2f33c2ecd034f397a7580d1694ac3c0bd910f54a7cb34f0b
BLAKE2b-256 checksum
How to use checksums
9d19794195fb973301551f91002c7712cbbeeb530818ca04ef6e0f6856701cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2026.

Transparency log

Release files / spirit_platform-2.2.5-py3-none-any.whl

Download URL spirit_platform-2.2.5-py3-none-any.whl
Size 246.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a09c27d78824fbc2704b7f4ce5a4b603093fc7959627a7d6944a79f8c45fa6a
BLAKE2b-256 checksum
How to use checksums
d7529933b5b39df5166d7408ba4e8e4a8cfc7af0c659e19f8ee7e012eff08f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.5 This release

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release 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