DOCS / TUTORIAL: HYPERLIQUID
Solana assets and Hyperliquid signing.
Authorize a Solana asset action and a Hyperliquid action under one application policy while the Solana assets stay on Solana.
Integration status: PairKey can sign supported Solana transactions, but Hyperliquid exchange actions need an exact action-encoding and signing adapter. This is a dual-signature design guide, not a working cross-chain trade or an atomic settlement protocol.
1. Keep assets in a Solana program vault
Use a Solana program to hold or control the asset and record its own balance, owner, allowed strategy and withdrawal conditions. PairKey signs only the Solana transaction that the vault actually requires. Solana custody does not give the Hyperliquid account a balance or collateral by itself; an off-chain risk engine must track both systems and enforce the application's exposure and settlement rules.
2. Derive separate signing keys
import * as web3 from '@solana/web3.js';
import {PairKeyClient} from '@pairkey/sdk';
const pairkey = new PairKeyClient({web3, storage: localStorage});
await pairkey.connect({
source: 'program', wallet, program: controllerProgramId,
mode: 'Onchain', namespace: 'org/acme/hyperliquid',
});
const solanaKey = await pairkey.key({chain: 'solana', path: [0]});
const tradingKey = await pairkey.key({chain: 'evm', path: [1]});
console.log(solanaKey.address, tradingKey.address);
Base Sepolia remains the default EVM chain. The updated SDK can select another EIP-155 chain ID when the hosted deployment advertises evm_chain_selection, but that is not a Hyperliquid action adapter. Do not register this address as a live trading key until exact Hyperliquid signing has been implemented and independently tested.
3. Bind both sides to one application decision
The risk engine proposes an approved market, side, maximum size, limit price, expiry and nonce after checking the vault state and current Hyperliquid exposure. The controller validates the proposal and exact Solana vault transaction or state transition. Commit a one-time decision through pairkey_approve_commit, then request the two signatures as separate jobs. Store both job IDs and reconcile each chain independently. Two signatures do not make execution atomic; the risk engine needs a defined response if only one side succeeds.
4. Add the Hyperliquid signing adapter
Hyperliquid documents separate signing schemes for L1 actions and user-signed actions. An adapter must reproduce its exact action hash, field ordering, nonce and domain, then return the recoverable signature expected by the exchange endpoint. Generic EIP-191 signMessage and EIP-712 signTypedData do not by themselves encode a valid Hyperliquid exchange action.
5. Verify both executions
After a supported adapter is available, submit the exact signed Solana transaction and Hyperliquid action, then independently verify Solana finality and the exchange response and resulting position. A completed PairKey job only proves signature production; it does not prove that the two systems settled together.