How a trade works
One buy, followed from your wallet to Hyperliquid's order book and back as shares in your wallet.
Every trade happens in two places at once: you post an order on Elysium, and the keeper makes the same trade on Hyperliquid. Shares are only minted after Hyperliquid has filled them, which is what keeps every share backed.
A buy, step by step
- You post the order. Your wallet sends the buy to the HIP-4 Markets contract with your amount and a price limit. The USDC moves into the contract and is held as escrow for that order. The app sets the limit 2% above the quote it showed you and never above 99.5¢.
- The keeper reads it. The keeper follows the contract every second. It reads Hyperliquid's order book for that side and works out how many whole shares your USDC buys without paying more than your limit.
- It buys on Hyperliquid. The keeper sends an immediate-or-cancel order for those shares, capped at your limit. Whatever doesn't fill at once is cancelled, so a buy never rests on the book.
- It fills on Elysium. The keeper reports the fill to the contract. The contract checks that the cost is within what you paid and that the average price is within your limit, then mints the shares to you and sends back the USDC the buy didn't use.
If Hyperliquid can't fill any shares within your limit, the keeper hands the order back and the full amount returns to you.
The keeper writes down every Hyperliquid fill before it sends the Elysium transaction. If it restarts in between, it completes the fill on Elysium and never buys the same order twice.
A sell
A sell works the same way in reverse. Posting it takes the shares out of your wallet and records your minimum price. The keeper sells them on Hyperliquid with an immediate-or-cancel order priced so that, after Hyperliquid's closing fee, the average still meets your minimum. Then the contract pays you. If only part of the shares found bids, the rest go back to your wallet in the same transaction.
How long it takes
Elysium blocks arrive several times a second and the keeper checks for new orders every second, so a normal buy or sell completes in a few seconds: your transaction, one order on Hyperliquid, and the fill transaction.
If the keeper doesn't respond
Any order still open 5 minutes after you posted it can be cancelled by you from the portfolio. A buy returns your USDC and a sell returns your shares. Nobody else can cancel your order except the keeper, and the keeper can only cancel by returning everything to you.
Limits on every order
| Rule | Value | Where it's enforced |
|---|---|---|
| Smallest buy | 1 USDC | contract |
| Highest buy limit | 99.5¢ per share | app |
| Average price on a buy | at or under your limit | contract |
| Average price on a sell | at or over your minimum, after fees | contract |
| Self-cancel | after 5 minutes | contract |
| Markets accepting orders | any side of an outcome that hasn't settled | contract |