Sequence/docs

Algo Commands

Lifecycle commands for WASM trading algos. A deployment is driven by a Sequence.toml at the project root — most commands read config from there and the deployment name defaults to the one in the file.

Note

sequence --sandbox <command> routes any command through paper-trading infrastructure (seq_test_ key, isolated edges). Sandbox uses live market data and never places real orders.


sequence init <name>

Scaffold a new algo project.

bash
sequence init my-algo

Creates a directory with Cargo.toml, src/lib.rs, .cargo/config.toml, and a starter Sequence.toml pre-configured for the WASM target. Project names accept alphanumerics, hyphens, and underscores.

If no API key is configured on the machine, init prompts for one via sequence login.


sequence build

Compile your algo to WASM. Run from inside your project directory.

bash
sequence build

Runs cargo build --target wasm32-unknown-unknown --release. Installs the WASM target automatically if missing, then reports the .wasm path and size.

Tip

Typical algo binaries are 10–50 KB. If yours is much larger, look for dependencies pulling in std allocators or unused crates.


sequence deploy

Upload and register the compiled WASM. All config comes from Sequence.toml in the current directory — venue, symbols, labels, risk limits, and per-instance mesh topology all live there.

bash
sequence deploy                   # Build + deploy based on Sequence.toml
sequence deploy --skip-build      # Deploy an already-built .wasm
sequence --sandbox deploy         # Paper-trade deploy
FlagDescription
--skip-buildSkip WASM build — use the existing .wasm artifact

The deployment name, target venues, labels, and risk are all declared in Sequence.toml. See Strategies & Mesh for the multi-instance layout.

Note

Deployments start in stopped state by default. This lets WebSocket subscriptions warm up on the target edges before your algo sees its first book update.


sequence start [name]

Start a stopped deployment.

bash
sequence start                    # Uses name from Sequence.toml
sequence start my-mm              # Explicit deployment name

sequence stop [name]

Pause a running deployment. All state is preserved — resume with sequence start.

bash
sequence stop
sequence stop my-mm

sequence undeploy [name]

Remove a deployment entirely. Stops the instances and deletes registration.

bash
sequence undeploy
sequence undeploy my-mm

sequence status [name]

Show current deployment state and per-edge health.

bash
sequence status
sequence status my-mm

Reports whether each instance is live, its last heartbeat, order counts, and any registration errors.


sequence logs [name]

Stream algo log output.

bash
sequence logs                 # Last 100 lines for the Sequence.toml deployment
sequence logs -f              # Tail live
sequence logs my-mm --follow  # Tail a different deployment
FlagDescription
-f, --followFollow logs in real time

Log levels are color-coded: INFO, WARN, ERROR, DEBUG.


sequence watch [name]

Live TUI showing orders, fills, per-edge latency, and mesh message flow in real time.

bash
sequence watch
sequence watch my-mm

sequence mesh [name]

Print the mesh topology — which labels are deployed where, and measured inter-instance latency for each (from, to) pair.

bash
sequence mesh

sequence trace <order_id>

Per-order lifecycle trace with nanosecond timestamps across submission → routing → venue ack → fill.

bash
sequence trace P-8f3a1b2c

Useful for debugging routing decisions and measuring tail latency on individual orders.


sequence tca [--symbol <pair>]

Transaction cost analysis for a deployment — slippage, fees, per-venue routing breakdown.

bash
sequence tca                      # Current deployment
sequence tca my-mm                # Named deployment
sequence tca --symbol BTC-USD     # Filter to a single pair

sequence intel <symbol>

Market-structure intelligence for a symbol: venue coverage, measured slippage curves, gas-adjusted DEX costs, and current SOR routing preference.

bash
sequence intel BTC-USD

sequence preflight

Pre-deploy readiness checklist. Verifies connected venues, available capital, risk limits, and deployment-name conflicts before you hit deploy.

bash
sequence preflight

sequence login

Store your Sequence API key locally.

bash
sequence login             # Prompts for live key
sequence login --sandbox   # Prompts for a seq_test_ key

sequence update

Self-update the CLI to the latest release. Downloads from GitHub, verifies SHA-256 checksum, and atomically replaces the binary.

bash
sequence update

Full Workflow

bash
# 1. Scaffold
sequence init my-mm
cd my-mm
 
# 2. Edit src/lib.rs with your strategy
#    Edit Sequence.toml to pick venue(s), symbols, and labels
 
# 3. Build
sequence build
 
# 4. Sanity check
sequence preflight
 
# 5. Deploy (starts stopped)
sequence deploy
 
# 6. Start
sequence start
 
# 7. Monitor
sequence logs -f        # or: sequence watch
 
# 8. Stop and tear down
sequence stop
sequence undeploy

Paper trading

bash
sequence login --sandbox
sequence --sandbox deploy
sequence --sandbox start
sequence --sandbox logs -f

Sandbox uses seq_test_ keys and routes through isolated sandbox infrastructure. Live market data, no real orders.