Ariadne

Liquidation takes your whole position at the worst price.

Ariadne watches your Hyperliquid liquidation price every 3 seconds. When the mark comes within 6% of it, Ariadne adds margin if it can, or closes the position reduce-only, before liquidation takes it.

See the 3–5 Dec replay

Demo: 10× BTC long from $44,000

Mark
…
Liquidation
…
Distance
…

Reading Hyperliquid…

Your positions

Connect any EVM wallet to read your Hyperliquid positions. Nothing is signed and nothing is sent until you arm the guard.

Read-only until you arm. Arming takes one signature that approves an agent wallet named “ariadne”. Agents can place orders. They cannot withdraw or transfer.

The same 10× long through 3–5 December, twice.

Real Hyperliquid BTC candles, 5 minutes each, from 2 Dec 00:00 UTC. Both copies open with $1,000 of margin at …. One is left alone. The other runs Ariadne’s rule: by default, close at the line, 6% before liquidation.

Left alone
…
Guarded
…

What the guard does on every tick.

  1. Read the account

    One clearinghouseState per armed account, every 3 seconds. Hyperliquid returns each position’s size, mark value and its own liquidationPx.

  2. Measure the distance

    distance = |mark − liquidation| ÷ mark

    Above your buffer (default 6%), nothing happens.

  3. Add margin, if it can

    An isolated position with free collateral gets updateIsolatedMargin: enough to put the line 7% away, capped by what is free.

  4. Otherwise close at the line

    A reduce-only IOC order for the whole position, limit at the mark minus 1% for a long, plus 1% for a short. It cannot open or flip a position. If you chose a partial step, 50% or 25%, it sells that share instead.

  5. Wait, then look again

    A 20 second cooldown per position. Part of it left and still inside the buffer, or an order that did not fill? It acts again. The position is gone? That guard stops.

Where the liquidation price comes from

liq = price − side × margin_available ÷ size ÷ (1 − l × side)

l is 1 ÷ maintenance leverage, which is twice the asset’s max leverage: 1.25% for BTC at 40×. For cross, margin available is account value minus all maintenance margin. For isolated, it is the position’s own margin minus its maintenance.

The guard acts on Hyperliquid’s own number. Ariadne’s formula is used to show what a cut or a top-up would do, calibrated on that number.

Why you can check it.

The formula matches Hyperliquid

On 6 Dec we read live public accounts from Hyperliquid’s leaderboard. On two classic cross accounts, 31 positions came out at exactly Hyperliquid’s liquidationPx. Every isolated position we found (six, on five accounts) matched exactly too.

Unified accounts margin with their spot USDC. There the formula landed within 0.5% on 12 of 26 positions and up to 10% off on the rest, and accounts that borrow are further off. This is why the guard always acts on Hyperliquid’s own number.

The signatures are Hyperliquid’s

The signing code reproduces the official Python SDK’s test vectors byte for byte. Live: a throwaway wallet signed approveAgent, a throwaway agent signed an order, and Hyperliquid named both recovered addresses, exactly the keys we made.

The agent cannot take your money

Hyperliquid agent wallets can place and cancel orders. They cannot withdraw, transfer or approve anything. Revoke it any time in Hyperliquid, under API. The key sits on our server encrypted with AES-GCM and is deleted when you disarm.

What it cannot do.

  • A gap faster than 3 seconds can still liquidate you. The guard acts on Hyperliquid’s mark price on each tick. A move through your whole buffer between two ticks is out of its reach.
  • Some cuts will not fill. IOC orders in a thin book can miss the 1% slippage cap. The guard logs it, waits out the cooldown and tries again.
  • Partial steps bleed in a one-way crash. In the 3–5 Dec replay, closing at the line kept $691 of $1,000. 25% steps kept $16, less than the $114 a liquidation leaves at best, and $0 if the backstop takes it. That is why the default closes the whole position.
  • Closing at the line ends the trade. If price turns back after the guard closes you, you are out of the move. Re-entering is your call; the guard never opens a position.
  • The agent key sits on our server. It is encrypted at rest and can only trade. Anyone who took the server and its secret could trade your account until you revoke the agent.
  • Not audited, and free. The code is small and tested, not audited. There is no fee and no builder code.

Questions.

Which wallet and chain do I need?

Any EVM wallet. The approval is signed on whatever chain your wallet is on: Hyperliquid accepts the chain id inside the signature. No gas, no transaction.

Will it ever open a position or add to one?

No. Every order is reduce-only, so it can only make a position smaller. It never withdraws or moves funds between accounts.

What happens when I close the position myself?

The next tick sees it gone, logs it and stops guarding that coin. With one rule for all positions, the guard stops when none are left.

How do I stop it?

Disarm here: the server deletes the agent key at once. Then revoke the agent in Hyperliquid under API. Revoking alone also stops it: the next refused order disarms the guard.

Why close the whole position by default?

Because the real 3–5 Dec crash says so. A 10× BTC long with $1,000 of margin, closed at the line, kept $691. With 25% steps it kept $16, because each step sold lower. Left alone, it kept $114 at best. You can still pick a 50% or 25% step, a buffer from 1% to 50% and a cooldown from 5 seconds to 10 minutes.