Algo Management
Deploy custom WASM algorithms that run on Sequence venue edges.
Prefer the CLI for algo management. The sequence CLI handles build, deploy, and lifecycle in one tool:
sequence build && sequence deploy BTC-USD --start
sequence logs BTC-USD --followSee the CLI Install & Login guide and the full command reference.
Sandbox isolation: All algo endpoints respect your API key mode. Requests authenticated with a seq_test_ (sandbox) key only interact with sandbox infrastructure - deployments go to sandbox edges, lists return only sandbox algos, and start/stop only affect sandbox deployments. Live (seq_live_) and sandbox (seq_test_) deployments for the same symbol are fully isolated. Pass --sandbox to the CLI or use a seq_test_ API key.
List Deployed Algos
/v1/algosReturns deployed algos for the authenticated client.
Query Parameters
| Parameter | Default | Description |
|---|---|---|
detail | omitted | Set detail=edge to include per-edge deployment details |
Response
{
"algos": [
{
"symbol": "XRP/USD",
"size_bytes": 10658,
"modified_at": 1706500000,
"status": "running"
}
]
}| Field | Type | Description |
|---|---|---|
symbol | string | Trading pair |
size_bytes | number | WASM binary size |
modified_at | number | Unix timestamp of last update |
status | string | Aggregate status across edges (running, paused, accepted, pending, rejected) |
Response (?detail=edge)
{
"algos": [
{
"symbol": "XRP/USD",
"size_bytes": 10658,
"modified_at": 1706500000,
"status": "running"
}
],
"edges": [
{
"symbol": "XRP/USD",
"edge_id": "venue-edge-kraken",
"deploy_id": "5c1b0c4a-0f8f-4f11-9a2e-5e8f7f3f17f5",
"status": "running",
"size_bytes": 10658,
"deployed_at": 1706500000,
"last_heartbeat": 1706500123,
"pause_reason": null,
"position_1e8": 0,
"realized_pnl_1e9": 0,
"session_realized_pnl_1e9": 0,
"unrealized_pnl_1e9": 0,
"callback_latency_ns": 42000,
"update_count": 18211
}
]
}Deploy Algo
/v1/algos/deployUpload and deploy a WASM algo.
Algos deploy in stopped state by default (start_immediately=false).
Request Body
{
"symbol": "XRP/USD",
"wasm_base64": "<base64-encoded .wasm file>",
"start_immediately": false,
"venue": "kraken"
}| Field | Required | Default | Description |
|---|---|---|---|
symbol | Yes | - | Trading pair (e.g., XRP/USD, BTC-USD) - both hyphen and slash formats are accepted |
wasm_base64 | Yes | - | Base64-encoded WASM binary (max 1MB) |
start_immediately | No | false | If true, algo starts trading immediately |
venue | No | null | Target a single venue (e.g. kraken, coinbase); omitted = all algo-capable edges |
Algo endpoints accept both BTC-USD (hyphen) and BTC/USD (slash). Symbols are normalized to slash format (BTC/USD) in all responses and the dashboard. All other API endpoints use hyphen format exclusively.
Response
{
"symbol": "XRP/USD",
"size_bytes": 10658,
"status": "deployed (pushed to 3/5 capable edges) - stopped (click Start to begin)",
"paused": true,
"pushed_to": 3,
"capable_edges": 5
}If no algo-capable edges are connected, deploy returns 400.
Start Algo
/v1/algos/{symbol}/startResume a stopped algo. The algo will start receiving market data and can place orders.
Path Parameters
| Parameter | Description |
|---|---|
symbol | Trading pair (URL-encoded, e.g., XRP%2FUSD) |
Query Parameters
| Parameter | Description |
|---|---|
venue | Optional venue target (kraken, coinbase, etc.). Omit to target all capable edges for that symbol. |
Response
{
"symbol": "XRP/USD",
"status": "running",
"edges_notified": 4
}Stop Algo
/v1/algos/{symbol}/stopPause a running algo. The algo keeps its state but stops receiving market data and placing orders.
Path Parameters
| Parameter | Description |
|---|---|
symbol | Trading pair (URL-encoded) |
Query Parameters
| Parameter | Description |
|---|---|
venue | Optional venue target (kraken, coinbase, etc.). Omit to target all capable edges for that symbol. |
Response
{
"symbol": "XRP/USD",
"status": "stopped",
"edges_notified": 4
}State persists across restarts. If you stop an algo and restart the server, it will remain stopped.
Undeploy (Delete) Algo
/v1/algos/{symbol}Remove a deployed algo artifact and broadcast undeploy to edges.
Query Parameters
| Parameter | Description |
|---|---|
venue | Optional venue target (kraken, coinbase, etc.). Omit to undeploy across all capable edges. |
Response
{
"symbol": "XRP/USD",
"deleted": true
}Get Algo Logs
/v1/algos/{symbol}/logsGet recent log entries from the algo.
Query Parameters
| Parameter | Default | Description |
|---|---|---|
edge_id | all edges | Optional edge filter (example: venue-edge-kraken) |
Response
{
"symbol": "XRP/USD",
"logs": [
{
"ts_ns": 1705420800000000000,
"level": "INFO",
"message": "BUY: trip=1 order=5001 @$1.800"
},
{
"ts_ns": 1705420800000000000,
"level": "WARN",
"message": "BUY FILL: order=5001 qty=220000000 @$1.801 latency=19ms"
}
]
}Logs endpoint currently returns the latest in-memory window (up to 100 entries). Timestamps are returned as ts_ns (nanosecond epoch), not formatted strings. Convert client-side as needed.
Get Algo Stats
/v1/algos/{symbol}/statsReturns aggregate best-effort stats for the symbol.
Response
{
"symbol": "XRP/USD",
"status": "running",
"position": 0,
"pnl": 0.0,
"trades": 12,
"orders": 44,
"fills": 12,
"rejects": 2,
"uptime_secs": 138
}Deployment API (v2)
Deployment-keyed endpoints manage multi-symbol algo deployments as a single unit. Each deployment gets a unique deployment_id and can contain one or more symbols.
The legacy /v1/algos/* endpoints above still work, but deployment-keyed endpoints are recommended for new integrations.
Create Deployment
/v1/deploymentsCreate a new deployment with one or more symbols.
Request Body
{
"symbols": ["ETH-USDC", "BTC-USDC"],
"name": "My MM",
"wasm_base64": "<base64-encoded .wasm file>",
"start_immediately": false,
"venue": "kraken",
"bundle_id": "bun_abc123"
}| Field | Required | Default | Description |
|---|---|---|---|
symbols | Yes | - | Array of trading pairs |
name | No | null | Human-readable deployment name |
wasm_base64 | No | - | Base64-encoded WASM binary (omit if using bundle_id) |
start_immediately | No | false | Start trading immediately after deploy |
venue | No | null | Target a single venue |
bundle_id | No | null | Deploy a registered bundle (omit wasm_base64 if set) |
List Deployments
/v1/deploymentsReturns all deployments for the authenticated client.
Response
{
"deployments": [
{
"deployment_id": "dep_8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"name": "My MM",
"symbols": ["ETH-USDC", "BTC-USDC"],
"size_bytes": 42000,
"desired_state": "running",
"edges": [
{
"edge_id": "venue-edge-kraken",
"symbol": "ETH-USDC",
"status": "running"
}
]
}
]
}Get Deployment
/v1/deployments/{deployment_id}Returns a single deployment with full edge details.
Rename Deployment
/v1/deployments/{deployment_id}Request Body
{
"name": "New Name"
}Delete Deployment
/v1/deployments/{deployment_id}Soft-deletes the deployment. Stops all edges and removes the deployment from listings.
Start Deployment
/v1/deployments/{deployment_id}/startStart a stopped deployment.
Query Parameters
| Parameter | Description |
|---|---|
venue | Optional venue filter. Omit to start across all edges. |
Stop Deployment
/v1/deployments/{deployment_id}/stopStop a running deployment. State is preserved.
Query Parameters
| Parameter | Description |
|---|---|
venue | Optional venue filter. Omit to stop across all edges. |
Get Deployment Logs
/v1/deployments/{deployment_id}/logsReturns recent log entries for the deployment.
Response
{
"logs": [
{
"ts_ns": 1710700000000000000,
"level": "INFO",
"message": "BUY: trip=1 order=5001 @$1.800",
"edge_id": "venue-edge-kraken"
}
]
}Timestamps are returned as ts_ns (nanosecond epoch), not formatted strings. Convert client-side as needed.
Get Deployment Metrics
/v1/deployments/{deployment_id}/metricsReturns time-series metrics for the deployment.
Query Parameters
| Parameter | Required | Description |
|---|---|---|
from | Yes | Start time (ISO 8601 or Unix timestamp) |
to | Yes | End time |
interval | Yes | Aggregation interval (e.g., 1m, 5m, 1h) |
edge_id | No | Filter to a specific edge |
symbol | No | Filter to a specific symbol |
Response
{
"deployment_id": "dep_8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"series": [
{
"ts": 1710700000,
"position_1e8": 150000000,
"realized_pnl_1e9": 1234560000,
"unrealized_pnl_1e9": -50000000,
"callback_latency_ns": 42000,
"fill_count": 12
}
]
}Get Deployment Traces
/v1/deployments/{deployment_id}/tracesReturns callback traces showing algo decision-making.
Query Parameters
| Parameter | Default | Description |
|---|---|---|
limit | 100 | Maximum number of traces to return |
type | all | Filter by callback type: on_book, on_fill, on_reject |
Response
{
"traces": [
{
"callback_type": "on_book",
"symbol": "ETH-USDC",
"ts_ns": 1710700000000000000,
"latency_ns": 38000,
"edge_id": "venue-edge-kraken",
"input": {
"book": { "best_bid": "3450.50", "best_ask": "3450.80" },
"spread_bps": 0.87,
"position_1e8": 50000000,
"pnl": 123.45
},
"output": {
"actions": ["cancel_all", "place_bid@3450.40", "place_ask@3450.90"]
},
"logs": ["spread tight, quoting aggressively"]
}
]
}Create Backtest
/v1/backtestSubmit a backtest job for a deployment.
Request Body
{
"deployment_id": "dep_8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"symbols": ["ETH-USDC"],
"start_date": "2026-01-01",
"end_date": "2026-01-31",
"capital_usd": 100000,
"seed": 42
}| Field | Required | Default | Description |
|---|---|---|---|
deployment_id | Yes | - | Deployment to backtest |
symbols | No | all deployment symbols | Subset of symbols to backtest |
start_date | No | - | Start date (YYYY-MM-DD) |
end_date | No | - | End date (YYYY-MM-DD) |
capital_usd | No | 100000 | Initial capital |
seed | No | 42 | PRNG seed for deterministic replay |
Response
{
"job_id": "bt_a1b2c3d4",
"status": "queued"
}Get Backtest Status
/v1/backtest/{job_id}Poll backtest job progress.
Response
{
"job_id": "bt_a1b2c3d4",
"status": "running",
"progress_pct": 45.2,
"events_processed": 1250000,
"total_events": 2764000,
"error": null
}| Field | Description |
|---|---|
status | queued, running, completed, failed |
progress_pct | Completion percentage |
events_processed | Number of market events replayed so far |
total_events | Total events in the date range |
error | Error message if status is failed |
Get Backtest Results
/v1/backtest/{job_id}/resultsReturns the full backtest result once the job completes.
Response
{
"job_id": "bt_a1b2c3d4",
"metrics": {
"total_pnl": 1234.56,
"sharpe": 2.1,
"max_drawdown_pct": 3.4,
"fill_count": 847,
"trade_count": 423
},
"equity_curve": [
{ "ts": 1704067200, "equity": 100000.0 },
{ "ts": 1704153600, "equity": 100234.56 }
],
"trades": [],
"traces": []
}Results are only available when status is completed. Requesting results for a running or failed job returns 404.
Dashboard Upload
You can also deploy algos via the Terminal dashboard:
- Go to Algo Studio
- Click Upload .wasm
- Select your compiled WASM file
- Algo deploys in stopped state
- Click Start when ready
File Naming Convention
Filename parsing is optional in the dashboard. If you follow this pattern, symbol is auto-detected:
| Filename | Symbol |
|---|---|
algo_btc_usd.wasm | BTC/USD |
algo_xrp_usd.wasm | XRP/USD |
algo_eth_usdt.wasm | ETH/USDT |
Any .wasm filename is accepted if you manually enter symbol as BASE/QUOTE.
Algo Lifecycle
┌──────────┐ Deploy ┌──────────┐
│ │ ───────────────▶│ │
│ None │ │ Stopped │◀───┐
│ │ │ │ │
└──────────┘ └────┬─────┘ │
│ │
Start│ │Stop
│ │
▼ │
┌──────────┐ │
│ │────┘
│ Running │
│ │
└────┬─────┘
│
Delete
│
▼
┌──────────┐
│ None │
└──────────┘
Deleting an algo stops it immediately and removes all logs. This cannot be undone.