How the engine works

Your orders go from your browser straight to the exchange. What runs where, how your keys are kept, and what happens when a tab closes, a connection drops or an answer never comes.

Where your orders come from

In your browser
The engine is written in Rust and compiled to WebAssembly. It runs in a background worker in your browser and talks to the exchange directly. Orders never pass through BackQuant’s servers.
Background tabs
Browsers slow a hidden tab’s timers but not a worker’s, so a tab in the background keeps trading at full speed. A computer asleep runs nothing.
Several tabs
Each exchange account runs once for the whole browser; every BackQuant tab is a window onto it. Closing one tab stops nothing while another is open. When the last one closes, the engine stops 15 seconds later. In Chrome and Edge a reload of the only tab finds the engine still running. A browser without shared workers runs an engine per tab, and only one tab trades each account.
One engine per account
Two keys saved for the same exchange account start one engine, not two. You choose which key trades it (the first added, until you choose); the other is not started, and Accounts says so on it.
Resting orders
Stay at the exchange when the engine stops, unless you turned on cancel on disconnect.
A new version
When a newer BackQuant opens in the browser, an engine with nothing running in it ends and its tabs are asked to reload. One running an algorithm, a stop it watches or an Auto-hedge trades on until that work is done.
Opening
While the account connects, the page does not wait empty. Exchange charts draw from candles kept on this device, the book, DOM and trades from the exchange’s public feed, and Positions and orders from the positions and working orders this device last saw. Each says it is not live yet (Last seen 2 min ago, not live yet; Book, public while connecting). None of it can send anything. The account’s own figures take its place once it is in.
Kept on this device
Those last positions and orders stay in this browser only, sealed with AES-GCM under a key the browser cannot export, for up to 12 hours. They are kept only while you are signed in with the keys unlocked, and wiped on sign-out, when the keys lock, or for one account when its key is removed. BackQuant’s servers never see them.

One device at a time

The lease
One browser trades an account at a time. The engine asks BackQuant’s server before it trades, and holds the account for 3 minutes from each yes, renewed while the server says so. The server keeps the account for that browser for 10 minutes from its last renewal, so two devices never trade one account at once.
Taking it over
On the device that does not hold the account, the market bar and the trade page footer offer Trade from this device. It needs a sign-in in the last 10 minutes: sign in again if it asks. On the device it was taken from, algorithms and Auto-hedges pause and the algorithms’ orders are withdrawn; plain orders keep working at the exchange.
Server unreachable
A browser trading an account trades on for what is left of its 3-minute hold, then takes no new orders until the server answers. Cancels always go.
What BackQuant’s servers see
Only that a browser holds an account: a salted tag of the account, a random id for the browser, and the time. No key, address, balance, order or position.

Your keys

Where
In this browser, on trade.backquant.com. The terminal trades through them and never receives them; neither does BackQuant.
Encrypted
AES-GCM, with a key this browser holds and cannot export, or with a passkey you choose. Each key is sealed to its exchange and account, so it opens for nothing else. In use, keys are decrypted into memory only, never written down decrypted, and gone once the engine stops.
Cannot withdraw
Checked before saving: a Hyperliquid main-wallet key, a Bybit key with Wallet permission, a Deribit key that can withdraw or transfer, and an OKX key that can withdraw are refused. Derive takes trading scope only, a RISEx session key signs orders and cannot withdraw, and a Lighter key cannot send funds anywhere but back to you. Binance does not show a key’s permissions to a browser: check Withdrawals is off yourself.

Every order, safely

Written down first
Before an order is sent, the engine writes what it is about to do to the browser’s own database. A restarted engine knows what it attempted. If that write fails, the account takes no new exposure; closes, stop moves, reduce-only orders and cancels still go.
Traceable
Every order carries an id naming its account, so one found at the exchange is always traced back.
Never sent twice
An order the exchange took and then went quiet on is Outcome unknown, and is never resent: by the engine or the terminal.
Outcome unknown
The engine checks with the exchange at once. Until it has, new orders are blocked but cancels still go, and any margin the order could use is held for it. A close, a stop move or a reduce-only order waits up to about 5 seconds for that check, then goes, or is refused saying why.
Checked with the venue
Balances and positions are re-read every 10 seconds, and orders and positions are reconciled after every reconnect, gap or doubt. The time shown is the last check that finished.
At startup
Until the first check with the exchange is done, a close, a stop move or a reduce-only order is held, not refused, and sent the moment the account is proven (up to 64 can wait at once). A close pressed before the positions are known is sized then, from the checked positions, and says what it closed.
When the books disagree
If the account and the exchange disagree about what is held, new orders wait for a clean read. Closes, reduce-only orders and stop moves are held until they agree, then sent; cancels go at once. After a minute you are told what is held.
No rounding behind your back
A size or price off the exchange’s step is refused, never changed for you. Only a size typed in dollars is rounded down to the step, and the ticket shows the result.

When the connection is not perfect

A dropped connection
Each connection is pinged; a silent one is dropped and reopened at once, then after 1 second, doubling to 60, with a little randomness so accounts do not all reconnect together. When the network is back, it tries at once. New orders wait until orders and positions are checked again; reconnecting alone is not enough. Cancels still go.
Rate limits
Out of the exchange’s order budget, new orders are refused before they are sent. Cancels, stop moves and reduce-only closes never are: they wait only for a time the exchange itself named.
Throttled by the exchange
New orders pause for the limit’s own window (2 seconds where the exchange states none, at most 60), or for as long as the exchange asks, up to 10 minutes.
Stale prices
The book and the tape say when they are not live. Algorithms and stops act only on fresh prices. A new order on a market nothing was following waits up to 3 seconds for its first price; an order that only reduces a position never waits.

Cancel on disconnect

Off by default, per account. When on, the exchange itself cancels your orders if BackQuant goes quiet: the last tab closed, the computer asleep, the connection lost. Your exits are kept out of it. Where the switch would take them, it is turned off, and confirmed off, before a take profit, stop or reduce-only order is sent, and comes back on once none works. If it cannot be confirmed off within 10 seconds, a stop or reduce-only close is sent anyway with a warning; an entry is not sent. Because the exchange may cancel within a minute of BackQuant going quiet, only true exits are kept out of it: a stop that would open a position is treated as an entry, and an entry carrying a take profit and stop is treated as an ordinary order until it first fills. Orders a switch cancelled are reported the next time BackQuant starts, and a take profit or stop the engine placed for an entry is placed again.

Hyperliquid
Every order on the account, 30 to 60 seconds after BackQuant stops. Turned off while a take profit or stop works. Needs $1M traded on the account. At most 10 times a UTC day; after that, off until 00:00 UTC.
Deribit
This connection’s orders, the moment it closes. Reduce-only take profits and stops, and an entry carrying them, go on a separate connection that never cancels, so they stay and the switch stays on.
Binance futures
Per market, 45 to 60 seconds after BackQuant stops while six markets or fewer have orders, longer with more (up to 8 minutes). Turned off only on a market where a take profit or stop works.
OKX
The orders BackQuant placed, 25 to 30 seconds after BackQuant stops. Turned off while a take profit or stop works.
Bybit, Derive, Lighter, Binance spot, RISEx
Not offered.

More

  • Exchange accounts and keys. Connecting, keys, cancel on disconnect per account.
  • Market bar and Actions. Trade from this device, Keep tab open and the account’s readiness.