Sequence/docs

Sandbox Mode

Test your strategies against live market data without risking real money. Sandbox orders route through a simulation adapter on each venue edge that matches against the real order book.


How it works

  1. Your order hits the SOR exactly like a live order
  2. The SOR picks the best venue(s) based on real market data
  3. Instead of submitting to the exchange, the edge's SandboxAdaptor simulates the fill
  4. The fill price is realistic — it uses the actual book depth and simulates market impact
  5. Fills, positions, and TCA all work the same as live
Tip

Sandbox fills are slightly worse than mid price (simulating taker fees + market impact). This makes backtesting more conservative than production.


Two ways to use sandbox

Option 1: Sandbox API key

Use a seq_test_* key. All orders automatically route through sandbox.

bash
export SEQ_API_KEY="seq_test_a1b2c3d4..."
sequence buy ETH-USD 50  # sandbox fill

Option 2: Per-order sandbox flag

With a live key, set sandbox=True on individual orders:

python
# Live key, but this order goes to sandbox
seq.buy("BTC-USD", 0.001, sandbox=True)
bash
sequence buy BTC-USD 0.001 --sandbox

What's real vs simulated

AspectSandboxLive
Market data (quotes, book, trades)RealReal
Order routing (SOR venue selection)RealReal
Fill pricesSimulated (against real book)Real exchange fills
FeesEstimated (10 bps default)Actual venue fees
Positions & P&LTracked in sandbox ledgerTracked in live ledger
Exchange API keys requiredNoYes
TCA reportsGeneratedGenerated

Sandbox settings

Configure sandbox behavior (requires seq_test_* key):

bash
curl https://api.sequencemkts.com/v1/sandbox/settings \
  -H "Authorization: Bearer $SEQ_TEST_KEY"

Reset sandbox state (clears positions and P&L):

bash
curl -X POST https://api.sequencemkts.com/v1/sandbox/reset \
  -H "Authorization: Bearer $SEQ_TEST_KEY"