TaifoonTAIFOON
Taifoon · Docs
API Reference

Strategy upload

Submit a strategy (Python or Rust source, or a packed WASM module) for the venue to run inside its sandbox against a warp session. Returns a session_id you drive with the standard sessions API.
Heads up
Strategy upload is PLANNED. The endpoint returns 404 today. Shape below is the contract we're building toward.
POST/strategy/v1/upload
PLANNED · 404
Upload a strategy artefact and mint a warp session that runs it on the matcher host.
Request body
FieldTypeRequiredDescription
namestringyesHuman-readable label for the run.
runtimestringyes"python3.11" | "wasm".
sourcestringyesBase64-encoded source file or .wasm module.
entrypointstringyese.g. "main.on_tick" for Python; "_start" for wasm.
windowobjectyes{ from, to, markets, speed_x } — same shape as sessions.
Response
FieldTypeRequiredDescription
session_idstringnoDrive with the standard /tape/v1/sessions API.
sandboxobjectno{ cpu_limit, mem_limit, fs: "tmpfs", net: "deny" }.
Code
# PLANNED
curl -s -X POST https://api.taifoon.dev/strategy/v1/upload \
  -H 'Content-Type: application/json' \
  -d "$(jq -nc --arg src "$(base64 -w0 strat.py)" '{
    name:"my-strat", runtime:"python3.11", source:$src, entrypoint:"main.on_tick",
    window:{ from:"2026-05-15T00:00:00Z", to:"2026-05-15T04:00:00Z", markets:["BTC-PERP"], speed_x:100.0 }
  }')"

Why this exists

For LLM-as-trader and bot writers who don't want to host their own decision loop, the venue can run the loop for you. The trade-off is a hard sandbox: no network, tmpfs scratch, CPU + memory ceilings, and a 6h wall-clock cap (same as warp sessions). The Phase B sandbox is wasmtime; the Phase A.2 Python sandbox is firejail.