The perps on the Trade page, and the shorts behind the hedged vaults, trade on Hyperliquid. Elyra is a client of that venue, not a venue itself. To give you one-click orders without a wallet popup for each one, an Elyra service called the signer holds a trade-only agent wallet for your Hyperliquid account. This chapter covers what that agent wallet can and cannot do, how an order is checked before it is signed, how Elyra's builder fee works, and what runs when no Hyperliquid account is connected.
- Your Hyperliquid account belongs to your wallet's address. The agent wallet your wallet approves can place, modify and cancel orders and set leverage. Hyperliquid does not let an agent wallet withdraw or transfer funds, and withdrawals always need your wallet.
- Elyra's fee on perps is a Hyperliquid builder fee. Your wallet approves a maximum once; each order names Elyra as builder at a rate no higher than that, and Hyperliquid collects it with the trade fee.
- Collateral is USDC in your own Hyperliquid account. Funding it from Elysium means bridging USDC out to HyperEVM first, which takes about 24 hours.
- The signer measures every order against Hyperliquid's current mark: the signed price must sit within 1,000 bps (10 %) of it, one order is capped at $250,000 of notional, and nothing is signed when there is no mark.
- Every write to
/perp/*carries an EIP-712 signature from your wallet over the exact request, a one-time nonce and a timestamp within 300 s. An opt-in trading session lets a key held by one browser tab sign orders and cancels instead, for at most 24 h; it can never withdraw.
Who holds which key
Hyperliquid accounts are addresses. An account can approve agent wallets, separate keys that sign orders for it and cannot move funds out. In Elyra the browser holds only your wallet, plus a key for orders and cancels while a trading session is on. The API checks that each write was signed by the wallet that owns the address, then forwards it; it holds no key. The signer (services/signer) generates and stores your agent wallet encrypted, signs within fixed bounds, and accepts calls only from the API, which signs each one with a shared secret over a timestamp and a one-time nonce, so a captured call cannot be replayed. Hyperliquid executes.
The agent wallet can place market and limit orders with exits attached, modify and cancel orders, set a market's leverage and read your account. Approving a new agent wallet needs your wallet's signature. So does every withdrawal or transfer: Elyra has no route that asks the signer for one.
Connect your Hyperliquid account
- 01Hold USDC on HyperliquidYour collateral is USDC in your own Hyperliquid account, at the same address as your wallet. If you hold USDC on Elysium, bridge it to HyperEVM through the Elysium bridge (withdrawals from Elysium take about 24 hours), then move it into your Hyperliquid account. The USDC never passes through Elyra. The Perp ticket reads your account (
GET /perp/account/:address) and moves on once Hyperliquid shows a balance. - 02Approve the agent walletThe Approve agent button signs a
POST /perp/onboard. The signer generates one agent wallet per address (asking again returns the same one), stores it encrypted and returns its address. Your wallet then signs Hyperliquid's agent approval for that address, and the API forwards it to Hyperliquid. - 03Approve the builder feeYour wallet signs Hyperliquid's builder fee approval once: Elyra's builder address and the most it may charge per trade. Hyperliquid refuses any order that names a higher fee, and you can lower the maximum or revoke it from your wallet at any time.
- 04TradeThe account read reports the agent and the builder fee as approved, and the set-up box disappears.
A smart-contract wallet is refused before any approval, because Hyperliquid's approvals need a signature from the account's own key. On the simulated venue the first step completes set-up and no deposit is asked for.
Elyra's builder fee
A Hyperliquid builder fee is a charge an app adds to the orders it sends, on top of Hyperliquid's own trading fee. It is paid in USDC from the trade, only on orders that name the builder, and only up to the maximum your wallet approved. Hyperliquid caps builder fees on perps at 0.1 % of notional. The ticket shows Elyra's rate before you approve it and beside every order.
Builder fees accrue to Elyra's builder account on Hyperliquid. An owner-run sweep brings them to Elysium and books them through the FeeRouter in each trader's name, so a referrer earns 20 % of what their referred traders paid, and the rest goes to the buyback. Orders the hedger sends for the hedged vaults carry no builder fee.
How an order is checked
The signer takes one write at a time per address, and signs an order only if every check passes:
- The address has an agent wallet (404) and Hyperliquid reports it approved (409).
- The request is well formed: side, type, a finite size above zero, leverage of at least 1 (422).
- Hyperliquid has a current mark for the market. Without one the answer is 503 and nothing is signed: a bound is only as good as the price it is measured from.
- The price to sign: a limit order uses your price. A market order uses
mark × (1 ± s), sent immediate-or-cancel, wheresis the requested slippage but never under 100 bps. A request over 1,000 bps is refused (422), not clamped. - That price is within 1,000 bps of the mark, whichever order type produced it (422).
- The size, rounded down to the market's size precision, meets the market's minimum unless the order is reduce-only, and size times mark is at most $250,000 (422).
The signer then sets leverage if you sent it, submits, and reads your account back. It reports success only when a market order has moved your position, or a limit order has moved it or rests on the book. An order Hyperliquid rejected returns its reason. One whose outcome cannot be read yet returns as unconfirmed: refresh orders and positions before sending it again.
The Perp form sends no slippage value, so every market order from it is priced at the mark plus or minus 1 %, as the form says beside the button. The liquidation price the form shows is Elyra's estimate from the market's margin rules, counting that order alone, without fees or funding. It is not Hyperliquid's own figure.
Stock perps
Stock and index perps are HIP-3 markets on Hyperliquid's xyz dex: xyz:NVDA, xyz:TSLA, xyz:AAPL, xyz:META and others, each named with its dex prefix. There is no SPY perp; the S&P 500 market is xyz:SP500, and that is the market Elyra uses to hedge EQSPY. Margin, leverage limits and liquidation on these markets follow Hyperliquid's rules for HIP-3 markets, and the ticket shows the limits of the market you picked.
The hedger uses the same signing path for the hedged vaults' shorts: market orders for the vault's hedge account, which is its funder's address, reduce-only when it buys back. The funder approves the signer's agent wallet for that account once, with the same onboard and approval steps the web makes.
Exit orders
Attach exits when you open a position in the Perp form, or add them later with SL / TP on a position in the terminal or in Portfolio. For a long the stop sits below the reference price and the take-profit above it; for a short, the other way round. The reference is your limit price for a limit entry and the mark otherwise. The form shows estimated gross PnL at each level, before fees, funding and slippage, and draws the levels on the chart.
The exits are Hyperliquid's own trigger orders, triggered by the mark price, and they rest on Hyperliquid with your browser closed:
- With a new entry they are grouped with it: they take effect when the entry fills, and one cancels the other. A reduce-only entry cannot carry exits.
- On an existing position an exit is reduce-only, on the closing side, and its size is capped at the position. Without
replaceExitsthe signer refuses new levels (409) while exits already rest in that market. - Changing levels never leaves the position without its exits. A new price for a resting stop or target modifies that order in place (
POST /perp/modify). Adding or dropping a level places the new exits first and then cancels the old ones; if that cleanup fails, both sets rest (every exit is reduce-only) and the answer says so.
A resting limit order's price and size, and an exit's trigger and size, can also be edited from the Orders tab. The signer checks the change like a new order: a limit price inside the band around the mark, a trigger on the side of the mark where it does not fire at once, the market's precision and minimum, and the notional cap.
A trigger does not promise a fill at its price: a gap or a thin book can leave part of the position open, so check it after one fires. When a reduce-only market order closes a position flat, the signer also cancels the remaining exits in that market, and says so plainly if it could not confirm the cleanup.
Your fills and funding come from Hyperliquid's public account data, newest first, a page at a time. GET /perp/fills/:address lists your fills (side, maker or taker, and the PnL a reducing fill realised); GET /perp/funding/:address lists the hourly funding settled on each position. At a positive rate longs pay shorts.
Signed requests
A request's address names an account, and a plain HTTP request proves nothing about who owns it. So every POST /perp/onboard, /order, /modify and /cancel carries an auth envelope: a nonce (0x plus 16 to 64 random bytes), a ts in unix seconds, and an EIP-712 signature by address over
PerpAction { string action; address account; bytes32 payloadHash; string nonce; uint256 ts }
under the domain { name: 'Elyra', version: '1', chainId }. The route fixes action. payloadHash is the keccak256 of the body without auth, as canonical JSON (keys sorted at every level, no whitespace), so your wallet signs the exact request and a signature cannot be moved to another body. The API and the web build this message from the same file, packages/core/src/perpAuth.ts.
requirePerpAuth checks, in order: a valid body and address (400), a well-formed envelope (401 unauthorized), ts within 300 s of the server clock (401 stale_ts), a signature that recovers to address over this body (401 unauthorized), and a nonce this address has not used (409 nonce_used). The nonce is spent only after the signature verifies, so a forged request cannot burn the owner's next nonce. It is remembered for 300 s plus 60 s of slack, after which the timestamp check already fails. Reads carry no envelope.
Trading sessions
Signing every order in your wallet is the default. To trade without a prompt for each one, turn on Trade without confirming each order in the Perp form and pick a length: 1 hour, 8 hours (the default) or 24 hours. The browser generates a new key for this tab, and your wallet signs one EIP-712 message under the same domain:
PerpSession { address account; address sessionKey; string[] actions; uint256 expiresAt; uint256 chainId }
sessionKey is the tab key's address, actions is order and cancel, and expiresAt is when the session ends. From then on the tab key signs each order and cancel over the same PerpAction as above, and the request carries the grant as auth.session; the nonce and the 300 s window apply as before. The key stays in the tab's memory and its sessionStorage, never in localStorage, and is never sent anywhere: a reload keeps the session and closing the tab ends it.
requirePerpAuth honours a grant on /perp/order and /perp/cancel only (403 session_scope on any other route), and only if it is well formed, its actions are order or cancel and include this route (403 session_scope), it has not ended (401 session_expired), it ends no more than 24 h, plus the 300 s window, after the server clock (401 session_invalid), your wallet's signature on it recovers to address on this chain (401 session_invalid), the request's signature recovers to sessionKey (401 unauthorized), and the session has not been ended (401 session_ended). Set-up and the Hyperliquid approvals always need your wallet.
While a session is on, the form shows Session active · ends HH:MM with End session. Ending it discards the key in this tab and revokes the grant at the API: the key signs one last POST /perp/session/end, and the API refuses that key from then until the grant would have expired, so a copy of it (a duplicated tab) stops working too. Disconnecting the wallet, or connecting another one, ends the session the same way.
Keyboard shortcuts
On the Perp ticket, B and S pick Long or Short, M and L a market or a limit order, Q W E R size the order from 25, 50 or 75 % or all of your free margin, and + and - step the leverage by 0.5x, within 1x and the market's maximum. A puts the cursor in the size and O moves the focus to the order button. No key places or cancels an order: the order goes when you press Enter on the button or click it, and with a trading session on, that is still the one step that sends it. Press ? in the terminal for every key, and read the app guide.
Order notifications
While Elyra is open with your wallet connected, it tells you when something happens to your orders: a resting limit order fills in full or in part, a stop loss or take profit triggers, a position closes with no order of yours behind it, or a Uniswap range order fills. A notice names the market, the side, the size and the price (the trigger, for an exit) and links to the terminal. The app compares each read of your resting orders and positions with the one before, the same reads the terminal makes every 15 s: the first read after the page opens only sets the starting point, each event is shown once, and what you do in this tab, such as a cancel, a market order or a close, is not reported back to you. A position closed with no order of yours behind it is shown as liquidated when the last mark was at the liquidation price the venue reports, and as closed otherwise. Nothing is checked while Elyra is closed. To hear about it while the tab is in the background, turn on Browser notifications under Order notifications on Alerts.
Prices and charts
Marks, 24 h change, volume, open interest and funding come from MarketData in the API, one cached view of every market Elyra lists, refreshed every 15 s from Hyperliquid's public API. A market with no mark is still listed, without one, and the app reads it as "no perp leg". Chart candles come from the same source and are cached for 60 s. The chart opens on the newest 1 000 bars, and scrolling to its left edge loads the 1 000 before them (GET /candles?before=), until an empty page marks the start of the history.
When the API cannot be reached, pages stay empty and a status notice says the data is unavailable.
Funding history
Hyperliquid settles funding every hour. The funding chart shows the settled rate for each hour of the last 7 or 30 days. It sits in the /markets brief, beside the Hedge panel, and in the trade terminal's Funding tab. Bars above the line are hours when longs paid shorts; bars below it are hours when shorts paid longs. Above the chart are the range's average and how many hours each side paid; hover over an hour to read it.
Per hour shows the rate as Hyperliquid settled it. Annualised multiplies each hour by 8,760 (24 × 365), simple and not compounded. That is what the past rate comes to over a year, not a forecast: funding changes every hour and can turn negative.
The series comes from GET /funding/history?market=<market>&range=7d|30d, oldest first. Each point carries time (unix seconds), rate1h (a signed fraction per hour, positive when longs paid) and rateApr (rate1h × 8,760). The API reads a market's 30 days once and serves both ranges from memory for a few minutes, with one read for every caller. When Hyperliquid rate-limits it, it serves the last series it read, marked stale; with nothing held it answers 503 with Retry-After. A market with no perp answers 404, and the chart says so.
The simulated venue
The API picks its venue from VENUE. The default builds SimVenue; the live setting builds a client for the signer. It is independent of how you sign in. SimVenue is a paper book priced from the real marks, so Trade and Portfolio work without a Hyperliquid account:
- Each new account starts with 10,000 USDC.
- Market orders fill 5 bps from the mark, against you. Limit orders fill when marketable, or rest until the mark crosses them.
- Margin is isolated per market, maintenance is half the initial margin (a 2x long is liquidated about 25 % down), and funding accrues hourly, longs paying a positive rate.
- Fills and funding settlements are kept (the last 500 of each) and served like Hyperliquid's.
- Stop-loss and take-profit orders work as they do on the live venue.
Nothing reaches Hyperliquid, and every write is still checked for a valid envelope.
Keys at rest
The signer keeps one file per address under KEY_STORE_DIR (/data in the Docker image). The agent wallet's private key in it is encrypted with a key derived from KEY_ENCRYPTION_SECRET, and the file is written under a temporary name, restricted to its owner, then renamed. The service will not start without SIGNER_SECRET and KEY_ENCRYPTION_SECRET, compares the shared secret in constant time, runs as an unprivileged user, and never logs key material. GET /health is its only open route.
The key store must be persistent. If it is lost, no funds move, since no agent wallet can withdraw, but every address must approve a new agent wallet.
Reference
Signer settings
| Name | Allowed | Default | Effect |
|---|---|---|---|
MARKET_SLIPPAGE_FLOOR_BPS | 100 bps | No default | fixed in code; no market order is priced tighter |
DEFAULT_SLIPPAGE_BPS | integer bps | 100 | when a market order sends none |
MARKET_SLIPPAGE_CEILING_BPS | floor to band bps | 1,000 | more is refused, not clamped |
LIMIT_PRICE_BAND_BPS | above 0 bps | 1,000 | furthest a signed price may sit from the mark |
MAX_ORDER_NOTIONAL_USD | above 0 USD | 250,000 | size × mark per order |
Errors from /perp/*
| Answer | Meaning |
|---|---|
400 invalid_* | a malformed field |
401 unauthorized / stale_ts, 409 nonce_used | the envelope failed a check |
401 session_invalid / session_expired / session_ended, 403 session_scope | a trading session's grant was malformed or too long, has expired or been ended, or was used beyond orders and cancels |
| 404, 409, 422, 400 from the signer | no agent wallet; not approved or exits already resting; outside a bound; rejected by Hyperliquid |
502 signer_error / signer_unreachable / signer_bad_response | the signer failed (a missing mark included), gave no answer within 10 s, or sent an unexpected shape |
503 signer_not_configured | the API has no signer secret |
Elyra