How Auto-hedge works

Auto-hedge is a dynamic delta hedger: it keeps the net delta of one coin’s book inside a band you set, trading one perpetual, future or spot market on its own. What it counts, when and how much it trades, every setting, what holds, pauses and stops it, and what it needs. To start one, see Auto-hedge: keep a coin neutral.

The names

Auto-hedge
The hedger for one coin’s whole book on an account: Actions, then Auto-hedge..., or AUTOHEDGE (also HEDGER) in the Pro terminal. It starts on Hyperliquid and Deribit accounts.
Keep neutral
The hedge choice on a multi-leg ticket (Structures and packages). It joins that coin’s Auto-hedge, or starts one for the package.
Hedge on fill
Not a hedger: one option’s delta hedged as it fills, at a ratio fixed at the start. See How delta hedging and greeks work.
HEDGE
The Hedge Calculator panel only works out a hedge; it sends nothing.

What it keeps

The book
Every position in the coin on this account, the hedge instrument’s own included, each turned into coin delta from the exchange’s own figures: an option at the exchange’s delta, a perpetual or future at its size (an inverse contract at its size over the mark). With the coin’s balance counts set to Yes, the coin held as a balance counts too; a spot hedge always counts it, and never sells more than is held.
Other accounts
Other accounts you tick next to Counting this account and count toward the book, on any exchange. They are read, never traded.
Where it keeps it
Neutral keeps the book at zero delta. As it is now locks the book as first measured whole, and hedges only what changes from there.
Never a partial book
A line that cannot be measured, or a figure older than Oldest figure (5 seconds by default, at most 10), holds it. A missing line is never read as zero.
Checked against the exchange
Where the exchange states a delta for every line, its total is compared with the engine’s. Further apart than Delta check, it holds rather than trade through the difference; held longer than Hold before pause, it pauses.

How it decides

  1. 01On every engine turn, at least every 250 ms, it measures the book and compares it with where it keeps it.
  2. 02Inside the band (Let it drift by, in coins either way) nothing trades. With Also check every set, a drift of at least one lot is traded back to the target on that timer, even inside the band.
  3. 03Outside the band it trades back to the target, or, with Rebalance to Band edge, only back to the edge of the band, which trades less.
  4. 04The size: the delta needed over one contract’s delta (an inverse contract’s at the mark), rounded down to the lot. Then cut, in order, to Largest rebalance, to what Most per hour has left over the last 60 minutes (a working order counts at its full size), and to Largest hedge position either way. Each cut is recorded. Below the exchange’s smallest order, nothing is sent.
  5. 05The order: one immediate-or-cancel limit across the touch, Ticks past the touch beyond it (2 by default), and never further than Price within bps from both the mark and the index. If the mark and the index are further apart than that, or the touch itself is beyond it, it holds. An order that fills nothing is a failed rebalance.
  6. 06One at a time: nothing new while the last order is working, settling or in doubt, and never sooner than Seconds between (10 by default, at least 1) after the last one started. The next measure waits until the last order’s fills are in the account, so the same delta is never hedged twice.
  7. 07Every decision is kept with its reason: Rebalanced (the side, size, worst price, the book before and after, and any cut), No trade, Held, Refused, Not sent or Paused. An unchanged decision is noted once a minute, and the last 200 are shown. Each rebalance is also on the Orders tab of Positions and orders.

Starting it

Preview first
Before Start auto-hedge, the engine measures the book and shows the first trade it would make. Nothing is sent.
No surprise first trade
Start allows the first rebalance to be at most what the preview showed plus one band’s worth, never more than Largest rebalance. If the book has moved further by then, nothing is sent: it measures again and shows the trade now.
One per coin
Refused while another hedger keeps the coin’s whole book on the account, while an option with Hedge on fill is still working in the coin, or while an order follows another account’s option by its delta. Refused too if its largest rebalance would break the account’s own order limits.

Every setting

The first three are up front in the window; the rest are under Advanced. The limits are sized from the book the preview measured, until you change one: the size below is how far the book may have to trade, its distance from the target plus the band, and at least four bands. Limits are in the hedge instrument’s own units; the band and the delta check are in coins.

Keep the coin
Neutral (the default) or As it is now. Another target can be typed under Advanced.
Hedge with
The perpetual, future or spot pair it trades on this account, perpetuals first.
Let it drift by
The band: how far the book’s delta may move either way, in the coin, before it trades. Smaller trades more often; larger lets more risk build up.
Rebalance to
Target: each trade brings the book back to where you keep it. Band edge: only back inside the band, so it trades less. Default Target.
Coin balance counts
Whether the coin held as a balance (spot, collateral) counts toward the book. A new one leaves it out.
Also check every s
Optional: also look at the book on a timer, not only when it changes; on that timer a drift of at least one lot is traded back to the target, even inside the band.
Largest rebalance
One trade at most the size.
Most per hour
Three times the size, over the last 60 minutes.
Largest hedge position
Twice the size, beyond what the hedge instrument already holds.
Price within bps
Never trades further than this from the mark and the index. Default 50.
Ticks past the touch
How far past the far side of the book a rebalance may fill. Default 2.
Delta check
How far its own count of the book may differ from the exchange’s before it holds. Default a tenth of the size, at least the band.
Seconds between
The least time between rebalances. Default 10.
Failures before pause
Failed rebalances in a row before it pauses. Default 3.
Flips before pause, Flips counted over min
Changes of direction (a buy, then a sell) within so many minutes before it pauses. Default 4 within 10.
Oldest figure s
The oldest figure it acts on, at most 10. Default 5.
Hold before pause s
How long it may hold before it pauses. Default 60.

Holds, pauses and stops

Holds
It waits, and goes on by itself once the condition clears: a line it cannot measure, no fresh price for the hedge instrument, the delta check out, the mark and the index too far apart, the account not ready, the hedge position at its cap, the hour’s limit used, or the account holding less than a package filled. Held longer than Hold before pause, it pauses.
Pauses
It waits for you to look and press Resume: an outcome unknown; Failures before pause rebalances in a row that filled nothing; Flips before pause changes of direction within the window, paying fees to stand still; the exchange refusing a rebalance in a way that would repeat; the exchange declining (busy, maintenance, throttling, a halted market), or rebalances not sent, for longer than Hold before pause; the engine missing more than 5 seconds; another device taking the account; a fill in the hedge instrument it did not make (a manual trade, a liquidation); the coin balance moving without a trade (a deposit, a withdrawal, a transfer); a first rebalance larger than Start allowed; a dated hedge instrument reaching expiry, which is not rolled (you are told a day before).
Resume
The failure count starts again. Resumed after an outside trade or a balance move, it takes the book as it then is, so the transfer is not traded and a liquidated hedge is not reopened. To hedge it all again, stop it and start another.
Stops
For good: Stop; a close (CLOSE, Flatten now, closing a package) or a cancel-all that covers its hedge instrument or any market in its book; a close or cancel-all on an account it counts. Pausing or stopping withdraws nothing: its orders are immediate, so nothing rests. The window then shows why it stopped, its decisions, and Start again with these settings.
Your own trades
A trade you make in the coin on a counted account changes the book, and Auto-hedge trades it back to the target. On the hedged account, the ticket warns of this before you send.

Where it runs

In the engine
In your browser, beside the exchange account it trades. Every BackQuant tab in the browser shares the engine, so closing one tab stops nothing while another is open, and in Chrome and Edge a reload of the only tab finds it still running.
When the engine stops
The last tab closed for 15 seconds, or the browser closed: it stops hedging. The next time the account starts, it shows Auto-hedge stopped while you were away, with the time of its last check, until you press Acknowledge. It never restarts by itself.
Asleep
A computer asleep runs nothing. Back, the gap pauses it, for you to look before it trades again.
A new version
A newer BackQuant opening in the browser does not end an engine that is running a hedger: the old tab hedges on, and its engine gives way once nothing runs in it.

What it needs

Exchanges
It starts on Hyperliquid and Deribit accounts; elsewhere Actions shows Auto-hedge (Hyperliquid and Deribit for now), greyed. Accounts on other exchanges can be counted: to keep a Derive option book neutral, open Auto-hedge on your Hyperliquid or Deribit account and tick the Derive account. An option ticket on Bybit, Derive or OKX offers the same as a button for each Hyperliquid or Deribit account open, such as Hedge on Hyperliquid (Auto-hedge, includes your Derive book): it counts every position in the coin on both accounts, not the option alone.
One device
This browser must hold the account, and every account it counts, through BackQuant’s one-device check (see How the engine works), so no other browser or device can run a second hedger on the same book. A resume needs it too.
One key
Deribit, Bybit, OKX and Binance know an account by its API key, so a second key on the same account would look like another account. Trading or counting one of them asks you to confirm it is the only key you use with BackQuant for that account.
Notifications
Start, and Resume, wait until browser notifications are on, so a stop is heard with the tab in the background.
While it runs
The screen is kept awake while the tab is in front, and going to the background brings a notification (at most once in 15 minutes). Every pause or stop raises a message, a notification and a sound. Closing the last tab that keeps it running asks first.
Red banner
If a running hedger has not decided anything for 20 seconds while the tab is in front, a red banner says the book is not being hedged.

Keep neutral on a multi-leg order

What it is
Keep neutral under the multi-leg ticket’s Hedge is the account’s Auto-hedge for the coin. Where one runs, the package joins it. On the options exchanges it starts on Deribit; on Bybit, Derive and OKX it is greyed and points to Auto-hedge on a Hyperliquid or Deribit account with the options account counted.
Started with the package
Where none runs, one starts first, keeping the book as it is, and the legs go only once it has measured and locked that book, so it hedges what the package changes. If it cannot measure, it is stopped and nothing is sent. If no leg is accepted, it is stopped again.
This package only
Where the legs go as one linked package, it can count only their fills and its own trades: your other positions and trades in the coin are not counted. If it does not start, the legs work unhedged and you are told.
Its own labels
The multi-leg ticket names the settings its own way: Rebalance beyond ± is Let it drift by, Max per rebalance is Largest rebalance, Max per hour is Most per hour, Price protection is Price within bps, and Count the coin balance is Coin balance counts.
Sized to the package
Rebalance beyond ± a quarter of the package’s delta, Max per rebalance the package’s delta, Max per hour three of those, Largest hedge position twice it, Price protection 50 bps, the coin balance not counted. Every figure is shown and can be changed.
Closing the package
From Positions and orders: stops a hedger started for it and closes what that hedger holds, with the legs.

More

  • Auto-hedge: keep a coin neutral. Starting one, step by step.
  • Structures and packages. Keep neutral in the multi-leg ticket.
  • Market bar and Actions. Where Auto-hedge... sits.