Mirror Hedge Bot

Purpose and when to use it

Hedges everything the Target Account holds with an opposite position of the same USD size on the Mirror Account, and follows every new fill there, by bot or by hand. Unfilled orders do not count. Partial fills and size rounding can leave a small imbalance for a while.

It works with real connections on Hyperliquid, Lighter, Lighter on Robinhood Chain, Aster, Bitunix, Pacifica, Ondo Perps and RISEx.

Setup and field meanings

Choose the Mirror Account, where the hedges trade, and the Target Account, the one being watched. Use two different accounts; they can be on the same exchange. Bitunix cannot be the Target Account. Mirror leverage (5x by default) is used on every hedged market and is capped at that market's MAX; if the MAX is missing, the market is not hedged instead of using 1x. The loss limit (100 USD by default) and what happens when it is reached are explained under Statuses, recovery and stopping.

Start and execution

Enable Mirror starts at once and stays Enabled until you stop it: it does not expire after five minutes. First it hedges the positions the Target Account already has; after that, every buy filled on the Target Account becomes a sell on the Mirror Account and every sell becomes a buy. It also checks the whole account regularly and after restarts. When the Target reduces, flips or closes, only the Mirror's own hedge changes: positions you have on the Mirror Account outside this bot are left alone.

A concrete example

The Target Account starts long 1,000 USD: the Mirror opens short 1,000 USD at once. Another 200 USD buy takes it to short 1,200; selling 300 brings it to short 900. If the Target flips to short 400, the hedge moves to long 400. If the Target holds +3 and -2 contracts of one market, it hedges the net +1, not both. Price differences and size rounding change the exact quantities.

Margin and fees

The Mirror Account needs free margin for the opposite positions at the chosen leverage, fees and open orders, even if the pair looks neutral. Lower leverage needs more margin but keeps the Mirror further from liquidation. Enable is refused if the Mirror Account cannot hedge the positions the Target Account already has. Leverage and margin are separate for each market. If a market on the Mirror Account already has positions outside this bot, that market is held instead of changing your settings. Each exchange liquidates on its own: you still manage funding, balances and margin on both accounts. You are notified when margin runs short and when a position on either account is within 15% of its liquidation price.

Fee estimates use the exchange's published fees; when they are missing (sometimes on RISEx), they are left out and the screen says so.

Statuses, recovery and stopping

Enabled can show HEDGES HELD when a market waits for data, margin or a leverage conflict; holding never closes positions by itself. Stop Mirror asks whether to keep the hedge positions (the default) or close only this Mirror's positions. Closing the dialog leaves the bot running. The choice cannot be changed and a stopped Mirror cannot restart; set up a new one instead. Orders still in progress are settled before closing starts.

Loss limit: the bot compares the combined value of both accounts (Target + Mirror) with their value when it started. That result includes fees, slippage, funding and price differences between the two exchanges. When the loss reaches the limit, the bot does what you chose: freeze the hedges and keep the positions, or stop and close only this Mirror's positions. Either way the Target Account keeps trading without hedge and you are notified. Deposits and withdrawals on either account also change the combined value: use Reset loss reference after moving funds. After a freeze caused by the limit, the same button resumes hedging; any other hold needs a stop and a new setup. You are also notified when hedges stop for any other reason.

Stopping, Closing and Closing held stay visible until nothing is left. Cancel is terminal once the chosen stop is finished. Exchange minimums, missing data or a failed order can leave a small amount held. The Target Account and any other positions are never touched, and the whole account is never closed.

The leftover is valued at a fresh price. It counts as done when the sum of absolute unmatched amounts across markets is at most 1 USD: opposite leftovers do not cancel each other out, and missing prices never count as hedged. A leftover below the exchange's minimum order stays held. Closing never rounds up into someone else's position; if the size step changed or a safe close is not possible, the bot shows Closing held.

Limits and market matching

Markets that do not exist on the Mirror Account's exchange are skipped; a temporary data error holds the market instead. Deactivating an account stops new hedges but lets the open ones settle. Partial fills, delays, size rounding and other positions on the Mirror Account can leave an imbalance. It never hedges its own hedges in a loop. A published MAX does not prove what your account is allowed to trade, and no points, rewards or perfect neutrality are promised.