Hedge on Hyperliquid
Optionally offset aggregate maker inventory with a dedicated external account.
On this page
Prepare the account
- Use a Hyperliquid account dedicated to this strategy.
- Fund its USDC separately from Depth collateral.
- Pair Solana devnet with Hyperliquid testnet.
- Approve the displayed agent with the account’s Ethereum wallet.
Enable managed hedging
Add hedge to your automation configuration. Keep the quote policy from the automation guide and choose explicit exposure, slippage, and timing limits. The following values are an example for test funds.
const setup = await maker.automation.configure({
quote: quotePolicy,
hedge: {
account: hedgeAccountAddress,
policy: {
ratioBps: 10_000,
thresholdNotional: 10_000_000n,
maxUnhedgedNotional: 100_000_000n,
maxOrderNotional: 100_000_000n,
batchMs: 5_000,
maxUnhedgedMs: 90_000,
maxSlippageBps: 10,
maxPriceAgeMs: 5_000,
orderTtlMs: 10_000,
maxLeverage: 1,
},
},
});
await maker.automation.approve(setup, { hedgeWallet });
await maker.automation.start();hedgeWallet is the Hyperliquid account owner’s signing wallet. The worker receives its approved agent key. If the agent is already approved externally, approval can verify it without hedgeWallet.
How hedges execute
The engine follows finalized aggregate maker inventory, batches small changes, and reconciles actual external fills. It saves orders before submission and retains the signed nonce and expiry on retries. Reversals reduce the prior hedge before opening the opposite side.
| Condition | Worker response |
|---|---|
| Stale external prices | Stop quoting. |
| Exposure outside policy | Stop quoting and reconcile. |
| Uncertain expired order | Reconcile its receipt before a replacement. |
| Worker paused or stopped | Keep existing positions open. |
Inspect hedge status
await maker.hedges.authorize();
const hedges = await maker.hedges.summary();Once a worker binds a hedge account, configuration cannot replace or remove it. Keep its recovery journal and durable storage with that maker.