Where the code is
There is no published package for this flow yet. The pieces live in two places:
Code on this page type-checks against the SDK, except where it uses the HyperEVM options noted in the text. It is illustrative. Fill in the values in square brackets from Network reference.
The flow
1. Derive a Sub-account
The key comes from your shielded signing key. You can recover every Sub-account from your wallet, so losing the browser loses nothing.deriveBurner.
Use a new index for every position. The app scans 24 indices when it looks for Sub-accounts it has used.
Anyone who has your spending key can derive all your Sub-accounts, in the past and the future. Guard it as you guard the shielded account.
2. Fund it
Funding is one adaptor call from the shielded balance. The adaptor calls Circle’s USDC deposit contract with the Sub-account as the recipient, in the same transaction. USDC is the only supported token, and the adaptor enforces a minimum amount. See Status and limits./fund endpoint. See Relayer API. The Sub-account is credited the full amount. The relayer fee is on top, taken from your notes.
Wait for the relayer’s job to confirm. Do not retry blindly. A second call pays again. The app records each attempt before it pays, and a retry for the same Sub-account waits for the first one to land.
3. Confirm the credit
The deposit lands on Hyperliquid, not on HyperEVM. Check the Sub-account’s ledger with Hyperliquid’s info API, request typeuserNonFundingLedgerUpdates. Look for a send from the USDC deposit contract to the Sub-account for exactly the amount you funded. That match is exact, and it holds while positions move the balance.
If the credit does not appear after a few minutes, it may still land. Do not fund the same Sub-account again until you have checked.
4. Trade
The Sub-account signs its own Hyperliquid actions. No Palliora contract and no Palliora server is involved. Use Hyperliquid’s API documentation for the signing rules, order formats and number formatting. The rules that matter for this flow:- Isolated margin. Call
updateLeveragewithisCross: falsebefore the first order. The account is new, so you cannot assume a margin mode. - One position per Sub-account. Reuse links positions to each other and, in the end, to a return deposit. The app refuses to open a position on a Sub-account that has already traded.
- Trading is gasless. Hyperliquid actions need no HYPE.
5. Move the money out
When the position is closed:- Move free USDC from perp to spot with the
usdClassTransferaction, withtoPerp: false. - Send the spot USDC to the token’s system address with the
sendAssetaction. For USDC (token index 0) that address is0x2000000000000000000000000000000000000000. HyperCore moves it to the Sub-account’s HyperEVM address. - Wait until the USDC shows in the Sub-account’s HyperEVM balance.
6. Buy return gas
The Sub-account holds USDC on HyperEVM but no HYPE, and the return needs gas. Buying the gas from the user’s main wallet would link the two for good, so the GasStation sells a small amount of HYPE for a flat USDC fee. The Sub-account signs an EIP-3009ReceiveWithAuthorization for the fee, and the relayer submits it. The Sub-account does not need gas to sign.
7. Return to your shielded balance
The Sub-account deposits its USDC to your main shielded address. Build the deposit with the user’sCore, because that makes the new note the user’s. Have the Sub-account submit it, because a deposit pulls tokens from the sender.
Rules for builders
The Sub-account’s own address is public once it acts, and the funding call carries it as the adaptor payload. The rule is about everything else.
Testnet differences
The testnet flow does not use the funding adaptor. The relayer funds the Sub-account. The user withdraws USDC and HYPE together from the pool in a single transaction, with the relayer as paymaster, and the relayer forwards the money to the Sub-account on Hyperliquid. The private testnet SDK has two builders for it:
The testnet derivation context is
veilnyx/hl-burner/v1/. The mainnet context is veilnyx/hl-burner/m1/.