Stocks trade all week here. The guard keeps up.
Hyperliquid lists perpetual futures on Nvidia, Tesla, SpaceX, Anthropic, the S&P 500 and more. They trade every hour of every day. The shares underneath don't: they stop at 4 p.m. in New York and on weekends, and the first trade after a pause can land far from the last.
Imperium is a terminal for those markets and for crypto. You open a position from your own Hyperliquid account. A guard then keeps your liquidation price a set number of typical moves away, measured every six seconds, and asks for more room when the stock market is closed.
Is my money safe with you?
We never hold it. Your funds stay in your own Hyperliquid account. The terminal creates a trading key in your browser and your wallet approves it. That key can place orders and move margin. It cannot withdraw or transfer. You set the most the guard may put behind a position, and you can take over or close at any time.
Getting started
What you need
- A wallet in your browser (Rabby, MetaMask or similar).
- USDC in your Hyperliquid account. Deposit at app.hyperliquid.xyz if you don't have any yet.
Your first trade
- Open the terminal and press Connect wallet.
- Sign one approval for the trading key. Nothing is spent.
- Pick a market, choose long or short and the amount to put in.
- Leave The guard selected, or choose Me to set leverage yourself.
- Confirm the order. The position opens at your starting leverage and the guard starts working.
Want to try it without money? Paper trading gives you $1,000 of pretend USDC with live prices and the same guard.
1. Overview
Imperium manages isolated perpetual positions on Hyperliquid. For each position it holds a target leverage, computed from short-term volatility and the market's session, and moves isolated margin toward it. Position size never changes after the open, so no order is placed to adjust risk.
2. Architecture
Everything runs in your browser. There is no Imperium server in the trading path.
browser ── info / WebSocket ──▶ api.hyperliquid.xyz (prices, candles, your account) browser ── signed actions ────▶ api.hyperliquid.xyz/exchange browser ── one transaction ───▶ rpc.elysium.kinetiq.xyz (optional record anchor)
Prices stream over Hyperliquid's WebSocket: activeAssetCtx for every listed market, trades and candle for the one you're viewing. Account state is read every three seconds with clearinghouseState, once for the main perps and once for the xyz stock markets.
Because the guard runs in your terminal, it acts only while the terminal is open. Close it and the position stays exactly as it is on Hyperliquid, at its last margin.
3. The guard
Every six seconds, for each position it manages, the guard:
- Measures σ, the typical one-hour move, from one-minute returns.
- Reads the session and its multiple k.
- Computes the required distance d* = k × σ and the target leverage L*.
- If the current leverage is more than 5% away from L*, moves one step toward it (at most 1× per check) by adding or removing isolated margin.
Two limits are enforced in code: the guard never puts more behind a position than your margin budget, and never leaves less margin than the exchange requires at the market's maximum leverage. If σ can't be measured, the guard holds.
4. Sessions
| Session (New York time) | Applies to | k |
|---|---|---|
| Regular · Mon–Fri 9:30–16:00 | Stocks, indices | 3.0 |
| Into the open · Mon–Fri 9:00–9:30 | Stocks, indices | 5.0 |
| Extended · 4:00–9:00, 16:00–20:00 | Stocks, indices | 3.5 |
| Overnight · 20:00–4:00 | Stocks, indices | 4.0 |
| Weekend · Fri 20:00 – Sun 20:00 | Stocks, indices, commodities | 5.0 |
| All week | Crypto | 3.0 |
Multiples are launch settings. They're chosen so that the required distance is larger exactly when the next trade can jump furthest from the last one.
5. Derivations
5.1 Liquidation distance
isolated long, margin M = N / L, maintenance rate m
liquidated when M + q(p − p₀) = m·q·p
distance d = (1/L − m) / (1 − m) long
d = (1/L − m) / (1 + m) short
5.2 Target leverage
L* = 1 / (d*(1 − m) + m) long L* = 1 / (d*(1 + m) + m) short L* = min(L*, 10, maxLeverage)
5.3 Volatility
rᵢ = ln(cᵢ / cᵢ₋₁) one-minute closes, last 180 v = EWMA(rᵢ², λ = 0.94) σ = √v × √60 typical one-hour move
5.4 The margin move
ΔM = N / L_next − M L_next is one step from L toward L*
m is half the initial margin at maximum leverage, so a 10× market has m = 5%. Large positions on Hyperliquid move into higher margin tiers; the guard reads the exchange's own liquidation price for those.
6. Connection and signing
Hyperliquid lets an account approve an agent: a second key that can place orders and move margin but cannot withdraw or transfer.
- The terminal creates a fresh key pair in your browser.
- Your wallet signs an EIP-712
ApproveAgentmessage naming that key, with the agent nameimperium. - The terminal checks the signature recovers to your address, then submits it to Hyperliquid.
- From then on the key signs your orders and margin changes. It is stored only in this browser.
domain { name: "HyperliquidSignTransaction", version: "1",
chainId: <your wallet's chain>, verifyingContract: 0x0 }
primaryType HyperliquidTransaction:ApproveAgent
message { hyperliquidChain: "Mainnet", agentAddress, agentName: "imperium", nonce }
Orders and margin changes are L1 actions: msgpack-encoded, hashed with the nonce, and signed by the agent as a phantom agent message on Hyperliquid's Exchange domain. To use the xyz stock markets with your main USDC balance, the agent sends agentEnableDexAbstraction once.
Disconnect deletes the key from this browser. To revoke it on Hyperliquid as well, approve a new agent or remove it in Hyperliquid's API settings.
7. Order lifecycle
| Step | Hyperliquid action | Notes |
|---|---|---|
| Open | updateLeverage (isolated) order (IOC, 1% through the mid) | Size rounded to the market's size decimals. Minimum $10 notional. |
| Adjust | updateIsolatedMargin (±) | One action per guard step, rounded to cents. |
| Close | order (reduce-only IOC) | Whole position. Remaining margin returns to your balance. |
Positions the terminal didn't open are shown and start under Me. The guard doesn't touch them until you hand them over.
8. Records on Elysium
When a position closes, the terminal builds a record: market, side, entry, exit and every guard step with its time, leverage before and after, and reason. It hashes the record with SHA-256.
Anchor switches your wallet to Elysium (chain 99901, HYPE for gas) and sends one transaction to your own address with the fingerprint in its data field, prefixed with IMP. Anyone with the record can hash it and compare.
Log downloads the record as the exact JSON that was hashed. Run shasum -a 256 on the file: the result is the fingerprint, and it should match the transaction's data after the 0x494d50 prefix.
9. Paper trading
Paper trading opens a $1,000 practice account with live Hyperliquid prices and the same guard. Fills happen at the live mid plus 0.05%. Liquidation follows the same formula as above. Results are pretend and stay in your browser.
10. Fees and $IMP
Imperium charges nothing to open, close or adjust a position. Hyperliquid's exchange fees apply as usual. The terminal is funded by creator fees on $IMP, which launches on Montra on Elysium. The contract address will be shown on this site and pinned on X at the same moment; anything earlier isn't us.
Trader rewards, paid in HYPE from creator fees, start with the token. $IMP is not a share of Imperium or of any revenue.
11. Verification
Signing verified
The terminal's signing code was run against the test vectors in Hyperliquid's official Python SDK: the phantom-agent hash of a production order, L1 signatures for orders (with and without client ids), trigger orders, vault actions, sub-account actions and scheduled cancels, and user-signed transfers and withdrawals. All 20 signatures and the hash matched byte for byte, on mainnet and testnet domains.
Arithmetic
Liquidation distance, target leverage and the margin move follow the formulas in section 5 and are shown live on the home page for any market.
Live orders
The order path uses the same actions as the official SDK. Start with a small position the first time you trade.
12. Limits and risks
- Leverage can lose your whole margin. A gap larger than the guard's distance between two checks can liquidate a position.
- The guard only acts while your terminal is open and online.
- Prices, fills and liquidations are Hyperliquid's. Outages there affect Imperium.
- Your trading key lives in this browser. Anyone with access to this browser profile can trade with it (but not withdraw).
- Nothing here is financial advice.