Class LiveRun

java.lang.Object
com.qtsurfer.api.client.model.LiveRun

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.24.0") public class LiveRun extends Object
A live run's full state, as returned by stopping it through its strategy, and the base of the representations returned by starting and by reading it. `warmFrom` is declared by those two (`LiveRunWithStream` and `LiveRunDetail`) and not here, because the response to stopping a run does not carry it.
  • Field Details

  • Constructor Details

    • LiveRun

      public LiveRun()
  • Method Details

    • strategyId

      public LiveRun strategyId(@Nonnull String strategyId)
    • getStrategyId

      @Nonnull public String getStrategyId()
      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.
      Returns:
      strategyId
    • setStrategyId

      public void setStrategyId(@Nonnull String strategyId)
    • runId

      public LiveRun runId(@Nonnull String runId)
    • getRunId

      @Nonnull public String getRunId()
      This run's own id — its canonical identity for `PATCH`/`PUT .../params` and for `GET /live/public`.
      Returns:
      runId
    • setRunId

      public void setRunId(@Nonnull String runId)
    • name

      public LiveRun name(@Nullable String name)
    • getName

      @Nullable public String getName()
      Get name
      Returns:
      name
    • setName

      public void setName(@Nullable String name)
    • description

      public LiveRun description(@Nullable String description)
    • getDescription

      @Nullable public String getDescription()
      Get description
      Returns:
      description
    • setDescription

      public void setDescription(@Nullable String description)
    • visibility

      public LiveRun visibility(@Nonnull LiveRun.VisibilityEnum visibility)
    • getVisibility

      @Nonnull public LiveRun.VisibilityEnum getVisibility()
      Get visibility
      Returns:
      visibility
    • setVisibility

      public void setVisibility(@Nonnull LiveRun.VisibilityEnum visibility)
    • stage

      public LiveRun stage(@Nonnull LiveRun.StageEnum stage)
    • getStage

      @Nonnull public LiveRun.StageEnum getStage()
      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`.
      Returns:
      stage
    • setStage

      public void setStage(@Nonnull LiveRun.StageEnum stage)
    • state

      public LiveRun state(@Nonnull String state)
    • getState

      @Nonnull public String getState()
      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.
      Returns:
      state
    • setState

      public void setState(@Nonnull String state)
    • desired

      public LiveRun desired(@Nonnull LiveRun.DesiredEnum desired)
    • getDesired

      @Nonnull public LiveRun.DesiredEnum getDesired()
      What you last asked for. `state` can lag this briefly after `DELETE`.
      Returns:
      desired
    • setDesired

      public void setDesired(@Nonnull LiveRun.DesiredEnum desired)
    • reason

      public LiveRun reason(@Nullable String reason)
    • getReason

      @Nullable public String getReason()
      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 pool address of a `dex` run is not a pool of its protocol on its chain, the platform has no room to follow the pool of a `dex` run, 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 cannot run, and will not by waiting, because its strategy cannot consume its source type or because the pool of a `dex` run is not a pool or has no room to be followed, is stopped by the platform itself (`desired: STOPPED`), so it holds no place.
      Returns:
      reason
    • setReason

      public void setReason(@Nullable String reason)
    • sources

      public LiveRun sources(@Nonnull List<LiveSource> sources)
    • addSourcesItem

      public LiveRun addSourcesItem(LiveSource sourcesItem)
    • getSources

      @Nonnull public List<LiveSource> getSources()
      Get sources
      Returns:
      sources
    • setSources

      public void setSources(@Nonnull List<LiveSource> sources)
    • params

      public LiveRun params(@Nonnull Map<String,Object> params)
    • putParamsItem

      public LiveRun putParamsItem(String key, Object paramsItem)
    • getParams

      @Nonnull public Map<String,Object> getParams()
      Get params
      Returns:
      params
    • setParams

      public void setParams(@Nonnull Map<String,Object> params)
    • paramsVersion

      public LiveRun paramsVersion(@Nonnull Integer paramsVersion)
    • getParamsVersion

      @Nonnull public Integer getParamsVersion()
      Increments on every accepted `PUT .../params` call, including one that resends the current values.
      Returns:
      paramsVersion
    • setParamsVersion

      public void setParamsVersion(@Nonnull Integer paramsVersion)
    • relay

      public LiveRun relay(@Nonnull Boolean relay)
    • getRelay

      @Nonnull public Boolean getRelay()
      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.
      Returns:
      relay
    • setRelay

      public void setRelay(@Nonnull Boolean relay)
    • startedAtMs

      public LiveRun startedAtMs(@Nonnull Long startedAtMs)
    • getStartedAtMs

      @Nonnull public Long getStartedAtMs()
      Epoch milliseconds.
      Returns:
      startedAtMs
    • setStartedAtMs

      public void setStartedAtMs(@Nonnull Long startedAtMs)
    • gate

      public LiveRun gate(@Nullable Map<String,Object> gate)
    • putGateItem

      public LiveRun putGateItem(String key, Object gateItem)
    • getGate

      @Nullable public Map<String,Object> getGate()
      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.
      Returns:
      gate
    • setGate

      public void setGate(@Nullable Map<String,Object> gate)
    • paper

      public LiveRun paper(@Nullable LivePaperConfig paper)
    • getPaper

      @Nullable public LivePaperConfig getPaper()
      The run's paper trading configuration as accepted at start, normalised. Absent when the run has no paper trading.
      Returns:
      paper
    • setPaper

      public void setPaper(@Nullable LivePaperConfig paper)
    • stats

      public LiveRun stats(@Nullable LiveRunStats stats)
    • getStats

      @Nullable public LiveRunStats getStats()
      The run's latest counters. Returned by the two reads, `GET /strategy/{strategyId}/live` and `GET /live/{runId}`; never by starting or stopping a run. Absent until the first snapshot exists (a run that has just started), and absent is not zero.
      Returns:
      stats
    • setStats

      public void setStats(@Nullable LiveRunStats stats)
    • equals

      public boolean equals(Object o)
      Return true if this LiveRun object is equal to o.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUrlQueryString

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string