Sequence/docs

Quick Start

Connect an exchange, see real prices, and submit your first order. Five minutes, no code required.


1. Get your API key

Create an account at sequencemkts.com, then go to Settings → API Keys → Create.

code
seq_live_a1b2c3d4...   ← live mode (real orders, real money)
seq_test_a1b2c3d4...   ← sandbox mode (live market data, simulated fills)
Warning

The full key is shown once at creation. Copy it immediately. Lost keys can be rotated.

bash
export SEQ_API_KEY="seq_live_your_key_here"

2. See live prices

No exchange connection needed — Sequence aggregates market data from all venues:

bash
curl https://api.sequencemkts.com/v1/quotes/BTC-USD \
  -H "Authorization: Bearer $SEQ_API_KEY"
json
{
  "symbol": "BTC-USD",
  "nbbo": {
    "bid": 74349.44,
    "ask": 74349.45,
    "mid": 74349.445,
    "spread_bps": 0.001
  },
  "venues": {
    "binance": { "bid": 74349.44, "ask": 74349.45, "bid_size": 3.2, "ask_size": 1.8 },
    "coinbase": { "bid": 74348.90, "ask": 74349.50, "bid_size": 5.0, "ask_size": 2.1 }
  }
}

3. Connect an exchange

Store your exchange API credentials. Sequence encrypts them with AES-256-GCM and never exposes raw keys.

bash
curl -X POST https://api.sequencemkts.com/v1/credentials/binance \
  -H "Authorization: Bearer $SEQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api_key": "your_binance_key", "api_secret": "your_binance_secret"}'

For Kalshi (API key ID + RSA PEM) and Polymarket (EVM signer key in extra_json), see the venue-specific credential bodies.

Or with the CLI:

bash
sequence connect binance
# prompts for API key + secret interactively

4. Check your positions

Everything you hold — fiat cash, crypto, perps, event contracts — lives in one endpoint. Filter by kind to narrow down.

bash
# Everything
curl "https://api.sequencemkts.com/v1/positions" \
  -H "Authorization: Bearer $SEQ_API_KEY"
 
# Cash only (fiat + stablecoins)
curl "https://api.sequencemkts.com/v1/positions?kinds=fiat,crypto" \
  -H "Authorization: Bearer $SEQ_API_KEY"
json
{
  "positions": [
    {
      "venue": "binance",
      "instrument": {"kind": "crypto", "symbol": "USDT"},
      "qty_1e8": 5000000000000,
      "current_price_usd_1e9": 1000000000,
      "current_value_usd_1e9": 50000000000000
    },
    {
      "venue": "binance",
      "instrument": {"kind": "crypto", "symbol": "BTC"},
      "qty_1e8": 150000000,
      "current_price_usd_1e9": 91200000000000,
      "current_value_usd_1e9": 13680000000000
    }
  ],
  "totals": {
    "nav_usd_1e9": 63680000000000,
    "cash_usd_1e9": 50000000000000,
    "num_positions": 2
  },
  "as_of_ns": 1776828335325953000
}

5. Submit your first order

Buy 0.1 ETH at market price. The SOR picks the best venue automatically.

bash
curl -X POST https://api.sequencemkts.com/v1/orders \
  -H "Authorization: Bearer $SEQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol": "ETH-USD", "side": "buy", "qty": 0.1}'
json
{
  "graph_id": "graph_7d769677a7b4448b...",
  "status": "active",
  "node_count": 1,
  "edge_count": 0
}

Track the order:

bash
curl https://api.sequencemkts.com/v1/execution_graphs/graph_7d769677a7b4448b... \
  -H "Authorization: Bearer $SEQ_API_KEY"
json
{
  "graph_id": "graph_7d769677a7b4448b...",
  "status": "completed",
  "nodes": {
    "order": {
      "status": "filled",
      "target_qty_1e8": 10000000,
      "filled_qty_1e8": 10000000,
      "avg_fill_price_1e9": 2325530000000,
      "fill_count": 1
    }
  }
}

6. Or use the SDK

Python (zero dependencies):

python
from sequence_markets import Sequence
 
seq = Sequence("seq_live_...", "https://api.sequencemkts.com")
 
# See the market
quote = seq.quote("ETH-USD")
print(f"ETH mid: ${quote['nbbo']['mid']:,.2f}")
 
# Buy
order = seq.buy("ETH-USD", 0.1, urgency="medium")
print(f"Order: {order['graph_id']}{order['status']}")
 
# Check status
status = seq.graph_status(order["graph_id"])
node = status["nodes"]["order"]
print(f"Filled: {node['filled_qty_1e8'] / 1e8} @ ${node['avg_fill_price_1e9'] / 1e9:,.2f}")

Rust:

rust
use sequence_sdk::{Sequence, Urgency};
 
let seq = Sequence::new("seq_live_...").base_url("https://api.sequencemkts.com");
let order = seq.buy("ETH-USD", 0.1).urgency(Urgency::Medium).submit().await?;
println!("Order: {} — {}", order.graph_id, order.status);

CLI:

bash
sequence login
sequence connect binance
sequence quote ETH-USD
sequence buy ETH-USD 0.1 --urgency medium

Next steps