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.
curl -fsSL https://releases.sequencemkts.com/cli/install.sh | sh
# or grab a binary directly:
# https://github.com/Sequence-Markets/execution-engine/releasesConfig lives at ~/.sequence/config.toml. Log in once:
sequence login
# paste your seq_live_... (or seq_test_... for sandbox)Global flags
Every subcommand accepts:
| Flag | Description |
|---|---|
--sandbox | Force sandbox routing for this invocation. Paper fills against live NBBO. Shorthand for logging in with a seq_test_* key |
-h, --help | Per-command help with flag listing |
-V, --version | CLI 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.
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.
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.
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:
| Flag | Description |
|---|---|
--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-closed | Include terminal closed/redeemed rows. Resolved event contracts surface by default — use this flag only for full historical view. |
--legacy | Temporary — return to the old per-symbol legacy output (removed in next release) |
Common uses:
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 viewsequence 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).
sequence fees BTC-USD
sequence fees KXMLBHR-26APR292140KCATH-ATHLBUTLER4-1:YES --venues kalshiFor 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]
| Flag | Type | Description |
|---|---|---|
--venue | string | Pin to a single venue; omit for SOR |
--limit-price | float | Price for limit order; omit for market |
--urgency | low / medium / high | SOR aggression tuning |
--max-slippage | u16 (bps) | Hard cap on slippage |
--policy | string | sor, twap, vwap, iceberg, passive, aggressive |
--horizon | duration | Execution horizon (30s, 5m, 1h) |
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.55sequence 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.
sequence amend graph_ab12:node_0:1 --price 0.55 --qty 15Mode reporting:
Output mode | Meaning |
|---|---|
cancel_replace | Today's behavior. Queue position lost |
native_atomic | Future (Kalshi) — queue preserved |
sequence decrease <id> --by <qty>
Shrink a resting order without touching price. Errors if the reduction would leave ≤ 0 remaining.
sequence decrease graph_ab12:node_0:1 --by 5sequence redeem <slug> --venue <venue>
Claim winnings from a resolved prediction market. Kalshi auto-settles; Polymarket fires a relayer POST.
sequence redeem KXBTCZ-26DEC31-T99000 --venue kalshi
sequence redeem fed-decision-in-october --venue polymarketsequence 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.
sequence init my-strategy
cd my-strategysequence 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.
| Flag | Default | Description |
|---|---|---|
<symbol> or --symbols BTC-USD,ETH-USD | — | Single-symbol positional, or multi-symbol flag |
--start YYYY-MM-DD | required | Window start |
--end YYYY-MM-DD | required | Window end |
--capital | 100000 | Initial capital in USD |
--venue | — | Limit to one/many venues, comma-separated |
--seed | 42 | PRNG seed for deterministic replay |
--skip-build | false | Reuse existing .wasm |
--bundle <id> | — | Replay using a registered bundle |
--queue-model | probabilistic | none, probabilistic, aggressive |
--latency-model | per-venue | none, log-normal, per-venue |
--output | text | text or json |
--no-save | false | Don't persist outcomes to Parquet |
--scan-buffer-secs | 3600 | Partition-scan lookahead |
--no-dedup | false | Disable cross-run book dedup |
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 jsonsequence 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]
| Flag | Default | Description |
|---|---|---|
--edge-threshold | 1000000000000 | Min fixed-point edge (1e12) to route through WASM |
--sor-threshold | 1000000000000 | Min edge to keep a venue in SOR's fan-out |
--min-venues | 2 | Minimum 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.
sequence research scan \
--where "venues ⊇ {binance,coinbase}" \
--where "adv_usd > 1_000_000" \
--rank-by sharpe --top 20 --evidencesequence 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.
| Flag | Default | Description |
|---|---|---|
--target-kind | edge | edge, sor, or assignment |
--days | 7 | Lookback window |
--store-root | CC default | Override Parquet root (local testing) |
sequence research recalibrate --bundle <id> [flags]
Drift check → re-profile → optional auto-promote.
| Flag | Default | Description |
|---|---|---|
--target-kind | edge | — |
--days | 7 | Lookback |
--store-root | — | Override Parquet root |
--auto-promote-to <stage> | — | Auto-promote if drift within tolerance |
--force | false | Skip 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:
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 sandboxSandbox fills settle against live NBBO with realistic slippage and fees. Balances + positions are isolated from your live account.
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Any error (auth, validation, network, API) — details on stderr |
Scripts can parse the API error as Error: <message> — no colorization on non-TTY.