Skip to content
SPECTRE
Xcoming soon

Quickstart

Write a strategy in Python, test it on your machine, package it, and seal it in the studio. Five commands.

Install

pip install https://spectrehl.com/sdk/spectre_sdk-0.1.0-py3-none-any.whl   # Python 3.11+
spectre init my-strategy && cd my-strategy

The wheel is served from this site. Its SHA-256 is listed next to it in /sdk/SHA256SUMS.

spectre init creates strategy.py, a manifest.json with conservative defaults, and a tests/ folder.

Write

A strategy is a class with one method, on_bar. It receives a Context and returns target positions as signed fractions of the reference portfolio's equity.

from spectre import Strategy, Context, Target

class SmaTrend(Strategy):
    """Long when the fast average is above the slow one, short when below.
    Loses money in rangebound markets where the averages cross often."""
    interval = "1h"

    def on_bar(self, ctx: Context) -> list[Target]:
        targets = []
        for coin in ctx.markets:
            closes = ctx.closes(coin, 120)
            if len(closes) < 120:
                continue
            fast = sum(closes[-20:]) / 20
            slow = sum(closes) / 120
            weight = 0.5 / len(ctx.markets)
            targets.append(Target(coin, weight if fast > slow else -weight))
        return targets

Test

spectre backtest strategy.py --from 2026-05-01 --to 2026-11-01
spectre paper strategy.py --minutes 60      # live Hyperliquid data, no orders

Backtests run on Hyperliquid candles and funding with fees and minimum order sizes applied. Their results stay on your machine. Listing pages never show them.

Package and seal

spectre package                 # writes dist/my-strategy.zip and prints its code hash

Upload the zip in the creator studio. The studio hashes it in your browser, shows you the hash, encrypts it to the sandbox's key and registers the manifest on Elysium.