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./strategy/v1/uploadPLANNED · 404
Upload a strategy artefact and mint a warp session that runs it on the matcher host.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Human-readable label for the run. |
| runtime | string | yes | "python3.11" | "wasm". |
| source | string | yes | Base64-encoded source file or .wasm module. |
| entrypoint | string | yes | e.g. "main.on_tick" for Python; "_start" for wasm. |
| window | object | yes | { from, to, markets, speed_x } — same shape as sessions. |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| session_id | string | no | Drive with the standard /tape/v1/sessions API. |
| sandbox | object | no | { 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.
