sequence-algo-sdk
Write ultra-low-latency trading algos in Rust, compile to WASM, deploy to Sequence Markets. Zero dependencies. The SDK provides the Algo trait, order book types, and action buffers — everything you need to write a trading algorithm that runs on Sequence's edge infrastructure.
Quick Start
# Cargo.toml
[]
= "my-algo"
= "0.1.0"
= "2021"
[]
= ["cdylib"]
[]
= { = "0.1", = false }
= "0.4"
[]
= "z"
= true
= 1
= "abort"
// src/lib.rs
extern crate alloc;
use *;
export_algo!;
!
static ALLOC: WeeAlloc = INIT;
Build & Deploy
Install the Sequence CLI and deploy:
Or build manually:
Key Types
| Type | Description |
|---|---|
Algo |
Trait your algo implements — on_book, on_fill, on_reject, on_shutdown |
L2Book |
20-level order book (688 bytes, fits in L1 cache) |
AlgoState |
Position + open orders, server-managed |
Actions |
Buffer for placing/canceling orders (up to 16 per tick) |
Fill |
Fill event with price, quantity, and timing |
Reject |
Rejection with typed error codes |
Fixed-Point Format
All prices and quantities use fixed-point integers for deterministic, allocation-free arithmetic:
- Prices:
px_1e9— multiply by 10^9 (e.g., $50,000.00 =50_000_000_000_000) - Quantities:
qty_1e8— multiply by 10^8 (e.g., 1.0 BTC =100_000_000)
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.