Phantom Agent Signing
Hyperliquid requires all order operations (place, cancel, trigger) to use an agent-based signing scheme at the protocol level. Even when the user signs directly, a temporary “phantom” agent is created per operation. This is a Hyperliquid protocol requirement, not an SDK limitation.
USER Mode
In USER mode, every trading operation requires the user’s wallet to sign a phantom agent approval. In a browser context this means a wallet popup for each action; with an ethers/viem signer it means a direct signature per action. This makes USER mode functional but impractical for active trading on Hyperliquid.
await perps.setSigningMode(userAddress, 'hyperliquid', 'USER');
// Every placeOrder, cancelOrder, and TP/SL requires a user signature
USER_AGENT Mode (Recommended)
USER_AGENT mode is strongly recommended for Hyperliquid. It requires a one-time agent approval, after which all trading operations are signed seamlessly by the SDK.
await perps.setSigningMode(userAddress, 'hyperliquid', 'USER_AGENT');
// One-time agent approval, then no more user signatures for trading
The agent keypair is stored in the browser’s localStorage, scoped per user + provider pair. Approved agents are visible in the account’s config.agents array (see Account Abstraction / Account Configuration).
UX Comparison
| Operation | USER mode | USER_AGENT mode |
|---|
| First-time setup | None | One-time agent approval |
| Place order | User signature (phantom agent) | Signed by SDK |
| Cancel order | User signature (phantom agent) | Signed by SDK |
| TP/SL | User signature per trigger | Signed by SDK |
| Withdrawal | User signature (always) | User signature (always) |
See also: Concepts / Signing Modes.