Sequence/docs

CLI

sequence — the trading OS from your terminal. Every Level 0 → 5 capability in the SDK maps to a subcommand. This page is a reference: every command, every flag, every default, grouped by the product ladder.

bash
curl -fsSL https://releases.sequencemkts.com/cli/install.sh | sh
 
# or grab a binary directly:
#   https://github.com/Sequence-Markets/execution-engine/releases

Config lives at ~/.sequence/config.toml. Log in once:

bash
sequence login
# paste your seq_live_... (or seq_test_... for sandbox)

Global flags

Every subcommand accepts:

FlagDescription
--sandboxForce sandbox routing for this invocation. Paper fills against live NBBO. Shorthand for logging in with a seq_test_* key
-h, --helpPer-command help with flag listing
-V, --versionCLI version

Level 0 — Connect

sequence login

Interactive prompt for your Sequence API key. Writes ~/.sequence/config.toml.

sequence connect <venue>

Store credentials for a venue. Prompts for the fields each venue needs — flat api_key / api_secret for CEX exchanges, an RSA PEM for Kalshi, an EVM signer key for Polymarket.

bash
sequence connect binance
sequence connect okx            # also asks for passphrase
sequence connect kalshi         # asks for key ID + pastes RSA PEM
sequence connect polymarket     # asks for signer private key (+ optional proxy / builder)

Supported venues: binance, coinbase, kraken, okx, bybit, kalshi, polymarket, hyperliquid, bitget, cryptocom, dex_ethereum, solana.

sequence disconnect <venue>

Delete stored credentials. Rotate before the session that uses the new key — edges cache credentials until reconnect.

sequence venues

List every connected venue with heartbeat state.


Level 1 — See

sequence quote <symbol>

Real-time NBBO + per-venue BBO.

code
NBBO         BID          ASK      SPREAD
best     2,325.53     2,325.54    0.00 bps

VENUE         BID          ASK    BID_SZ    ASK_SZ    AGE
binance   2,325.53     2,325.54     12.4       8.1    42ms
coinbase  2,325.48     2,325.60      0.8       1.2    55ms

Works with CEX pairs, Polymarket slugs, Kalshi tickers, and raw token IDs.

sequence positions [flags]

Unified view of everything you hold — fiat cash, crypto, perps, and event contracts — across every venue in one table. The legacy sequence balances command remains and shows the same wallet rows, but positions is the recommended unified view.

code
INSTRUMENT         VENUE        KIND        QTY        ENTRY         MARK    UNREAL. P&L
USDC               kraken       crypto    4999.9999      1.00         1.00          +$0.00
USDC               coinbase     crypto    2378.4835      1.00         1.00          +$0.00
BTC                coinbase     crypto       0.00000002  0.00    91,200.00          +$0.00
XRP                coinbase     crypto      29.1003720   0.00         0.58         +$16.96
ETH                dex:arb      crypto       0.0070454   0.00     3,280.50         +$23.11
USDC               dex:arb      crypto       2.9805750   1.00         1.00          +$0.00
USD                kalshi       fiat       100.0000      1.00         1.00          +$0.00
USDC               polymarket   crypto     329.9975      1.00         1.00          +$0.00
────────────────────────────────────────────────────────────────────────────────
NAV                            $    7,852.45
  Cash                         $    7,812.48
  Unrealized P&L                         +$40.07
  Realized P&L                            +$0.00
  Fees                                    +$0.00

Flags:

FlagDescription
--venue <name>Filter by venue (repeatable or comma-separated: --venue kraken,coinbase)
--kind <kind>Filter by instrument kind: fiat, crypto, perp, event_contract (repeatable or comma-separated)
--include-closedInclude terminal closed/redeemed rows. Resolved event contracts surface by default — use this flag only for full historical view.
--legacyTemporary — return to the old per-symbol legacy output (removed in next release)

Common uses:

bash
sequence positions                                    # everything
sequence positions --kind fiat,crypto                 # cash only
sequence positions --kind perp                        # perps only
sequence positions --venue kalshi,polymarket          # prediction markets only
sequence positions --include-closed                   # historical view

sequence symbols

Every tradable instrument. Filter with grep or pipe through jq if you've set --output json in a future invocation.

sequence fees <ticker> [--venues kalshi,polymarket]

Maker/taker fees per venue for one ticker. Renders a small table; means the venue has no fee data yet (treat as do-not-route, not free).

bash
sequence fees BTC-USD
sequence fees KXMLBHR-26APR292140KCATH-ATHLBUTLER4-1:YES --venues kalshi

For size-aware estimates that evaluate the venue-specific fee curve at your exact price + qty (Kalshi binary, Polymarket CTF), see the SDK's preview() — there's no sequence preview command yet; it's coming alongside the rest of the pre-trade TCA work.


Level 2 — Trade

sequence buy <symbol> <qty> [flags]

sequence sell <symbol> <qty> [flags]

FlagTypeDescription
--venuestringPin to a single venue; omit for SOR
--limit-pricefloatPrice for limit order; omit for market
--urgencylow / medium / highSOR aggression tuning
--max-slippageu16 (bps)Hard cap on slippage
--policystringsor, twap, vwap, iceberg, passive, aggressive
--horizondurationExecution horizon (30s, 5m, 1h)
bash
sequence buy  ETH-USD  50
sequence buy  ETH-USD  50  --urgency high  --max-slippage 10
sequence sell BTC-USD  0.5 --venue coinbase --limit-price 75000
sequence buy  BTC-USD  1   --policy twap   --horizon 5m
sequence buy  fed-decision-in-october 10 --venue polymarket --limit-price 0.55

sequence orders [--symbol <sym>]

List orders, optionally filtered by symbol. Status / side come back UPPERCASE.

sequence cancel <id>

Accepts either a graph_... ID or a full graph:...:node:seq node-order ID. Cancels every active node in the graph.

sequence amend <id> [--price P] [--qty Q]

Venue-agnostic amend for resting orders. At least one of --price / --qty required.

bash
sequence amend graph_ab12:node_0:1 --price 0.55 --qty 15

Mode reporting:

Output modeMeaning
cancel_replaceToday's behavior. Queue position lost
native_atomicFuture (Kalshi) — queue preserved

sequence decrease <id> --by <qty>

Shrink a resting order without touching price. Errors if the reduction would leave ≤ 0 remaining.

bash
sequence decrease graph_ab12:node_0:1 --by 5

sequence redeem <slug> --venue <venue>

Claim winnings from a resolved prediction market. Kalshi auto-settles; Polymarket fires a relayer POST.

bash
sequence redeem KXBTCZ-26DEC31-T99000 --venue kalshi
sequence redeem fed-decision-in-october --venue polymarket

sequence fills [--symbol <sym>]

Fill history with venue, price, quantity, fee.


Level 4 — Automate

sequence init <name>

Scaffold a new algo project. Creates Cargo.toml, src/lib.rs, Sequence.toml, .gitignore.

bash
sequence init my-strategy
cd my-strategy

sequence build

Compile the current project to wasm32-unknown-unknown and strip. Output ends up at target/wasm32-unknown-unknown/release/*.wasm.

sequence backtest [flags]

Run against the sim-engine with recorded Parquet market data.

FlagDefaultDescription
<symbol> or --symbols BTC-USD,ETH-USDSingle-symbol positional, or multi-symbol flag
--start YYYY-MM-DDrequiredWindow start
--end YYYY-MM-DDrequiredWindow end
--capital100000Initial capital in USD
--venueLimit to one/many venues, comma-separated
--seed42PRNG seed for deterministic replay
--skip-buildfalseReuse existing .wasm
--bundle <id>Replay using a registered bundle
--queue-modelprobabilisticnone, probabilistic, aggressive
--latency-modelper-venuenone, log-normal, per-venue
--outputtexttext or json
--no-savefalseDon't persist outcomes to Parquet
--scan-buffer-secs3600Partition-scan lookahead
--no-dedupfalseDisable cross-run book dedup
bash
sequence backtest ETH-USD --start 2026-01-01 --end 2026-03-01
sequence backtest --symbols BTC-USD,ETH-USD --start 2026-01-01 --end 2026-01-07 \
                  --capital 250000 --latency-model log-normal --output json

sequence preflight

Pre-deploy readiness checklist. Verifies venues connected, capital sufficient, risk limits loaded, no conflicting deployments.

sequence deploy [--skip-build]

Compile (unless --skip-build), push the WASM to every hosting edge, and start the deployment. Reads Sequence.toml for strategy name, symbols, initial params.

sequence logs [<name>] [-f|--follow]

Strategy stdout/stderr. -f tails in real time.

sequence status [<name>]

Deployment snapshot: per-edge position, P&L, fill count, callback latency.

sequence start [<name>]

sequence stop [<name>]

sequence undeploy [<name>]

Pause, resume, delete. stop does NOT cancel resting orders — handle those in your on_stop hook.

sequence watch [<name>]

Live deployment TUI — refreshes every second with positions, fills, and inter-instance mesh latency.


Level 5 — Monitor

sequence trace <node_order_id>

Nanosecond-precision lifecycle trace. Every event from SOR admission → edge dispatch → venue ACK → first fill → terminal state.

sequence intel <symbol>

Market structure snapshot: venue market-share, spread regime, toxicity score, quote-to-trade ratio.

sequence mesh [<name>]

Mesh topology for multi-venue algos: per-instance label, peer latencies, message counts.

sequence tca [<name>] [--symbol <sym>]

Transaction cost analysis. Per-strategy or cross-desk, optionally filtered by symbol.


Bundle subcommands

Bundles are compiled, signed, content-addressed artifacts that capture either an edge algo, a SOR policy, or an assignment policy. Used for reproducible deploys and policy staging.

sequence bundle compile-edge --wasm <path> --artifact <id> [--strategy <family>] [--risk-version <v>]

Wrap a WASM blob into an edge bundle. Defaults: --strategy mm-pro, --risk-version v1.

sequence bundle compile-sor --routing-model <ref> --impact-model <ref> [--slicing-policy <p>]

Compile a SOR policy bundle from a routing-model + impact-model pair. Default slicing: vwap.

sequence bundle compile-assignment --artifact <id> [flags]

FlagDefaultDescription
--edge-threshold1000000000000Min fixed-point edge (1e12) to route through WASM
--sor-threshold1000000000000Min edge to keep a venue in SOR's fan-out
--min-venues2Minimum venues required for SOR

sequence bundle promote --bundle <id> --target <t> --stage <s> --eval-run <id> --approver <email> [--break-glass] [--notes "..."]

Promote a bundle to a deployment stage (canary, pilot, production). --break-glass bypasses the drift-check gate — requires --notes.

sequence bundle list

Every compiled bundle with stage, promoted-at, approver.


Research subcommands

Research engine operates on recorded Parquet data — lives alongside the sim-engine.

sequence research scan [--where "expr"]... [--rank-by <field>] [--top N] [--evidence]

Predicate-based pair scanning. Repeat --where for AND-composed clauses.

bash
sequence research scan \
  --where "venues ⊇ {binance,coinbase}" \
  --where "adv_usd > 1_000_000" \
  --rank-by sharpe --top 20 --evidence

sequence research profile <symbol> [--venue <v>] [--days <n>]

Deep single-pair profile: microstructure, cost model, regime classification. Default --days 7.

sequence research materialize --start <date> --end <date>

Batch-materialize profiles for a historical window. Writes back to the research store.

sequence research coverage [--symbol <s>]

Show recorded-data coverage: partition density, gaps, last-ingest timestamp.

sequence research feature-eval --feature <name>... --label <name>... --start <d> --end <d>

Walk-forward IC evaluation. Repeat --feature and --label for multi-feature/label runs.

sequence research monitor --bundle <id> [flags]

Performance drift check for a live bundle.

FlagDefaultDescription
--target-kindedgeedge, sor, or assignment
--days7Lookback window
--store-rootCC defaultOverride Parquet root (local testing)

sequence research recalibrate --bundle <id> [flags]

Drift check → re-profile → optional auto-promote.

FlagDefaultDescription
--target-kindedge
--days7Lookback
--store-rootOverride Parquet root
--auto-promote-to <stage>Auto-promote if drift within tolerance
--forcefalseSkip drift-check gate
--baseline-eval <id>Pin the drift comparison baseline

sequence research artifacts [--type <kind>]

sequence research artifact <artifact_id>

List / inspect research artifacts (profiles, feature evaluations, drift reports).


Meta

sequence update

Self-update to the latest release. Preserves ~/.sequence/config.toml.


Sandbox mode

Two ways in:

bash
sequence buy BTC-USD 0.01 --sandbox         # one-off
sequence --sandbox buy BTC-USD 0.01         # global flag also works
sequence login                              # then paste a seq_test_* key — always sandbox

Sandbox fills settle against live NBBO with realistic slippage and fees. Balances + positions are isolated from your live account.


Exit codes

CodeMeaning
0Success
1Any error (auth, validation, network, API) — details on stderr

Scripts can parse the API error as Error: <message> — no colorization on non-TTY.