Live Execution

Get this strategy's current (or most recent) live run

Changed on

The run you last started for this strategy — its most complete state, including params and the promotion gate once the sandbox trial has one to report. Returns the run's last known state even after it has stopped; this endpoint never disappears history. When the run was started with a stream, streamUrl is here too while the run is running and your plan allows it.

While the run is being executed it also carries stats, the run's latest counters (updates processed, rate, instruments seen), refreshed about once a minute. Starting or stopping a run does not return them; read them here.

get/strategy/{strategyId}/live

Request

  • Base URL: https://api.qtsurfer.net/v1
  • URL: https://api.qtsurfer.net/v1/strategy/{strategyId}/live
  • Auth: HTTP bearer

Path parameters

strategyIdstring required

Unique identifier for a compiled strategy, derived from the source itself: the same code always yields the same id, for every caller. How much formatting the id ignores depends on the language — see POST /strategy for exactly which rewrites preserve it and which do not.

Example:6bsh31ikwkuivhtgcoa6s4

The id returned by POST /strategy

Response

The run's current state, with its streamUrl when it has one

strategyIdstring required

Unique identifier for a compiled strategy, derived from the source itself: the same code always yields the same id, for every caller. How much formatting the id ignores depends on the language — see POST /strategy for exactly which rewrites preserve it and which do not.

runIdstring required

This run's own id — its canonical identity for PATCH/PUT .../params and for GET /live/public.

namestring
descriptionstring
visibility'private' | 'public' required
stage'SANDBOX' | 'LIVE' required

A new run starts SANDBOX, a 24-hour trial in which it is compared against a second execution and checked for resource use and stability. A run that passes moves to LIVE automatically when the 24 hours are up. A run of a strategy that an earlier run of yours already took through the trial starts LIVE, unless you started it with sandbox: true.

statestring required

The run's health right now: STARTING (no runner has reported on it yet), RUNNING, LAGGING (behind the market data, usually while catching up; clears by itself), HUNG (stuck inside one strategy call for longer than allowed; clears when it returns), DEGRADED (its independent executions produced different signals), FAILED (refused, could not start or failed while running; reason says why) or STOPPED. LAGGING, HUNG and DEGRADED come and go on a running run. The set may grow: read an unknown value as a running run with something to look at. See the Live execution guide.

desired'RUNNING' | 'STOPPED' required

What you last asked for. state can lag this briefly after DELETE.

reasonstring

Why the run stopped or failed, when there is something to say; absent otherwise. It is never a stack trace or an internal message. Either resource: ... (the platform stopped the run for exceeding its resource allowance; the text says which limit) or one of a fixed set of sentences for a FAILED run: the strategy cannot consume the source type the run was started with, the run's definition was refused, the run could not start after several attempts, the strategy failed while processing data, the run lost its data feed, or the generic The run failed.. The set may grow: read an unrecognised sentence as a failure and do not parse it. A FAILED run usually stays desired: RUNNING until you stop it, and counts as active (409 on a new start, and toward your live-run limit) until then; one that can never run because its strategy cannot consume its source type is stopped by the platform itself (desired: STOPPED), so it holds no place.

paramsobject required
paramsVersioninteger required

Increments on every accepted PUT .../params call, including one that resends the current values.

relayboolean required

Whether this run's signals are relayed over the WebSocket channel described in the "Live execution" guide. It is the value requested at start, in either stage.

startedAtMsinteger required

Epoch milliseconds.

gateobject

The sandbox trial's promotion verdict. Absent for the whole 24-hour trial and present once it ends, so an absent gate means the trial has not finished. A run that started in LIVE without a trial has it from the start: the verdict of the earlier run it relies on, with inheritedFrom naming that run. passed is the verdict; the rest is diagnostic detail whose shape is not yet stabilized as public API: treat it as opaque.

warmFrominteger

The warmFrom in effect for this run, in seconds: the one requested when the run was started or, when none was, the one the platform chose (the distance from the run's start back to the start of the current 15-minute block, 0 to 900). It is never null. It is present on every run started since the field exists and absent from a run started before it existed. It never changes while the run exists.

streamUrlstring uri

The run's secret stream URL (wss://…). Treat it like a password: anyone who holds it can read this run's signals, from the sandbox stage on. Present only when the run was started with stream: true, is wanted running, has not had its stream revoked, and your plan still lets you broadcast; absent otherwise (a plan that lets you broadcast again gets the same URL back). Rotate it with POST /live/{runId}/stream if it leaks, revoke it with DELETE /live/{runId}/stream.

Example response

{
  "strategyId": "6bsh31ikwkuivhtgcoa6s4",
  "sources": [
    {
      "venueType": "cx",
      "exchange": "binance",
      "segment": "spot",
      "instruments": [
        "BTC/USDT"
      ]
    }
  ]
}

Changes