Skip to content

Runtime model

System architecture overview

Structure runs strategy revisions through three operating paths:

In the current target-position execution path, the strategy revision and Target Position Executor are both part of what users evaluate. The data source, execution destination, account context, and run lifetime change by path.

Direct order actions are roadmap functionality. When introduced, they will let strategies place, cancel, and modify orders directly for strategies that need order-level control.

Core operating paths The selected revision and Target Position Executor stay central while the data source, execution destination, and run lifetime change by path.
Live deployment Long-running
Live market data server
Strategy engine
Target Position Executor
Live exchange gateway
order messages
Live venue
Paper deployment Long-running
Live market data server
Strategy engine
Target Position Executor
Venue Simulator
Simulated fills and account state
Backtest job Finite job
Historical market data server
Strategy engine
Target Position Executor
Venue Simulator
Result metrics and context
Simulation boundary Paper deployments and backtest jobs use the Venue Simulator and produce evidence under assumptions.
Live boundary Live deployments send order messages through the live exchange gateway and can affect real capital.
Legend
  • Market data Live or historical market data sources.
  • Strategy engine Runtime evaluation of the selected compiled revision.
  • Target Position Executor Target-position intent converted into order activity.
  • Live exchange gateway Venue-facing live order message boundary.
  • Venue Simulator Simulated execution destination and assumptions.
  • Account state Live or simulated positions, fills, balances, and order state.
  • Results Recorded metrics, telemetry, and review context.
  • Live path Long-running live deployment or live venue boundary.
  • Paper path Long-running paper deployment boundary.
  • Backtest path Finite backtest job boundary.

Structure separates the trading workflow into six major runtime components.

ComponentRole
Live market data serverStreams current venue market data into live deployments and paper deployments.
Historical market data serverStreams historical market data into backtest jobs.
Strategy engineEvaluates the selected compiled strategy revision and emits target positions.
Target Position ExecutorReceives target positions and manages order activity for the selected execution destination.
Live exchange gatewaySends order messages to live venues and receives live venue order messages.
Venue SimulatorProvides simulated execution for paper deployments and backtest jobs.

Live market data server -> Strategy engine -> Target Position Executor -> Live exchange gateway

A live deployment is a long-running path. It receives live market data, evaluates the selected strategy revision, and routes order activity through the live exchange gateway for the connected venue account. The live path interprets target positions against live account state, venue permissions, live venue constraints, fills, order state, and health signals where available.

Live market data server -> Strategy engine -> Target Position Executor -> Venue Simulator

A paper deployment is also a long-running path. It receives live market data and evaluates real-time strategy behavior, but order activity goes to the Venue Simulator instead of a live venue. The paper path evaluates the selected revision and current Target Position Executor behavior under simulated account state and simulator assumptions.

Historical market data server -> Strategy engine -> Target Position Executor -> Venue Simulator

A backtest job is finite. It starts with a configured historical time range, runs the selected revision through that range, records results, and terminates when the requested evaluation completes or fails. The backtest path evaluates the selected revision and current Target Position Executor behavior against historical market data, starting balances, and recorded simulator assumptions.

The runtime uses a small set of message categories across the paths.

Message categoryWhat it represents
Market data messagesPrice, trade, funding, or other market inputs available to the strategy revision.
Strategy evaluation messagesThe strategy engine’s evaluation of the selected revision against incoming data.
Target position messagesThe strategy’s desired exposure after evaluation.
Order activity messagesThe Target Position Executor’s order activity based on current account state and target positions.
Account state messagesLive or simulated account balances, positions, fills, and order state surfaced for review.
Result and telemetry messagesJob status, deployment health, logs, metrics, assumptions, and run context.

The exact fields vary by path and venue. The important user-facing boundary is stable: Structure keeps strategy logic, market data, target-position intent, execution destination, account state, and result telemetry separate enough to review.

For the detailed execution boundary, see Target-position execution model and Execution context and account state.

Live deployments and paper deployments keep running until the user stops them or a failure path ends the deployment.

Common deployment lifecycle states:

  • drafting: the deployment parameters are being specified by the user.
  • provisioning: Structure is preparing the selected revision and runtime path.
  • running: the deployment is active.
  • stopping: Structure is shutting the deployment down.
  • stopped: the deployment is no longer running.
  • failed: the deployment could not start or continue.

Backtest jobs are finite evaluations.

Common backtest job lifecycle states:

  • drafting: the user is filling out the job parameters.
  • provisioning: Structure is preparing the selected revision and runtime path.
  • running: historical data is driving the selected revision.
  • completed: the job finished and results are available.
  • failed: the job stopped before completion and exposes an error reason where available.

A strategy revision contains the strategy model that Structure evaluates: DAG logic, state-machine logic, fixed node parameters, validation state, compile output, and the compiled revision artifact used by the runtime. Structure constructs validated strategy revisions into Rust code for runtime evaluation. Users do not manage that code directly, but the compiled revision artifact and compile output stay connected to the saved revision.

Strategy Variables are run-provided values for node parameters exposed by the strategy author. A live deployment, paper deployment, or backtest job can provide concrete Strategy Variable values without changing the revision’s fixed logic.

Venue and instrument are revision-owned parameters. A run shows those values with the deployment or job context so users can understand what was evaluated or operated.

Structure exposes failures at the workflow surface where users can act on them.

Failure areaWhat users review
Strategy validation or compile failureThe revision, validation state, and error detail available in the strategy workflow.
Market data gapThe requested range, available complete segments, and any result caveats for affected backtest jobs.
Backtest job failureThe job status, selected revision, time range, Strategy Variable values, simulator settings, and error detail where available.
Paper deployment issueDeployment status, live market data availability, simulator context, logs, and health state.
Live deployment issueDeployment status, connected account, venue messages, order state, permissions, logs, and health state.