Skip to main content

Programmable cryptocurrency trading platform — write your own strategies, run on your own hardware

Project description

Spirit

Spirit is a programmable cryptocurrency trading platform — a playground for building and testing your own trading strategies in Python. 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.


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

  • v2.2.1 — first public release. Free + Plus tiers, single-machine deploy, paper or live mode.

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

Project details


Download files

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

Source Distribution

spirit_platform-2.2.3.tar.gz (190.0 kB view details)

Uploaded Source

Built Distribution

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

spirit_platform-2.2.3-py3-none-any.whl (216.2 kB view details)

Uploaded Python 3

File details

Details for the file spirit_platform-2.2.3.tar.gz.

File metadata

  • Download URL: spirit_platform-2.2.3.tar.gz
  • Upload date:
  • Size: 190.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spirit_platform-2.2.3.tar.gz
Algorithm Hash digest
SHA256 d91d56fd52ae5e1888b0c2aa1cf8eda25d72bc062c50af0765ab05173369f0e2
MD5 3bf5d02dba8ed2dc2dbd64e13b04ba90
BLAKE2b-256 8f4bd7773189752f92967f067603a67e866d3505f132e79aeb9a4dab50598a95

See more details on using hashes here.

Provenance

The following attestation bundles were made for spirit_platform-2.2.3.tar.gz:

Publisher: publish.yml on timoz10/spirit-platform

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

File details

Details for the file spirit_platform-2.2.3-py3-none-any.whl.

File metadata

  • Download URL: spirit_platform-2.2.3-py3-none-any.whl
  • Upload date:
  • Size: 216.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spirit_platform-2.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1d599a4bffd5d9862d8fd976631161d049e8ae94943f63f3ecbf32d23872c14c
MD5 5cf0c2f9a7a7a1bf4f30d30eb4d1d1f0
BLAKE2b-256 ae781bdba0b97b693f64d8c47af918c88ab095438925fff35692ef3fb5d1a964

See more details on using hashes here.

Provenance

The following attestation bundles were made for spirit_platform-2.2.3-py3-none-any.whl:

Publisher: publish.yml on timoz10/spirit-platform

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page