Skip to main content
Before trading on Hyperliquid, users must complete the provider’s setup steps. The SDK provides methods to discover, build, sign, and submit them. Every user choice, such as the account mode, is also a setup step. It carries its own options. An unfunded account reports accountExists: false with no setup steps. Deposit first (the first deposit pays Hyperliquid’s one-time account creation fee), then run checkSetup(). The flow:
  1. Check — checkSetup() returns the outstanding setup steps, the checklist, and whether the account is ready
  2. Run each step — executeProviderSetupAction() signs and submits one staged step end-to-end
  3. Apply each choice — executeProviderOption() executes the option the user picked for a choice step
A choice step is never in required.setup. It appears on required.checklist with its current selected option, and it keeps isReady false until it is satisfied. A choice can also block the steps after it, because executeProviderSetupAction() refuses a step while a lower sequence step on the checklist is unsatisfied. The snippet therefore handles the checklist one item at a time. The SDK never applies a choice for the user: the snippet takes the recommended option only to keep the example short. See How checkSetup() treats each step and Account Mode. If you call the API without the SDK, see Integrating without the SDK. Parameters for checkSetup: Returns: ProviderSetup Parameters for executeProviderSetupAction: Returns: Promise<ExecuteActionResponse>. Read results[i].status: a refusal is a Failed result, not an exception. PerpsError covers a step that cannot be signed or submitted before any result is known.

Steps in sequence order

Every step uses the eip712 signing method. relay: API means the signed step goes to POST /executeAction. Hyperliquid has no relay: CLIENT step.

Setup descriptors

approveAgent

Authorizes an agent wallet to sign trading operations on the user’s behalf. This is the one-time wallet signature that enables agent-based trading — once approved, the SDK-managed agent can place, cancel, and modify orders without wallet popups.

revokeAgent (conditional)

Deregisters an existing agent to free one of the account’s agent slots. Hyperliquid performs this through the same approveAgent typed-data primitive with a matching name, so it carries no distinct primary type on the wire. Marked as a conditional setup step: checkSetup() stages it only when every named agent slot on the account is already taken, and omits it from checklist otherwise — it never renders as a satisfied step for an account with a free slot.

accountMode

A choice of how Hyperliquid combines the spot and perps balances of the account. It is USER-signed: the agent-side operation can only initialize a never-set mode and cannot safely change an existing account, so every transition needs a user signature. The SDK never applies this step for the user. The Unified Account option carries default: true. This marks it as the recommended option for a UI. It is a hint only. Nothing is changed until the user picks an option and the client executes it with executeProviderOption(). An account that has never set a mode reads as Manual. dexAbstraction is not supported. The provider does not advertise it. An existing account that uses it stays readable, and it has no matching option, so the step reads as unsatisfied for such an account. For a full explanation of what each mode means — balance unification behaviour, capital efficiency, and signing requirements — see Account Abstraction.

setReferrer

Applies the LI.FI referral code to the account. The step is signed by the SDK-managed agent, not the user’s wallet, so it is sequenced after approveAgent, and checkSetup() applies it without a separate wallet prompt. Tell your users that a referral code is applied. The provider does not advertise it when no referral code is configured.

approveBuilderFee

Approves the LI.FI builder fee on the user’s Hyperliquid account. Hyperliquid requires explicit builder fee approval before orders can be routed through third-party builders like LI.FI. Approves LI.FI’s Hyperliquid builder wallet at the configured maximum rate. If the venue confirms the account has no approval, placeOrder fails with a setup-required error. The step is revocable. Its revoke points at revokeBuilderFee, an entry in actions with signer: USER and relay: API. It takes no params. It approves the builder fee again at a 0% maximum rate. After the revoke, the step is unsatisfied and checkSetup() stages it again.

Low-Level API

Using the low-level API directly. agentAddress must be the address of an agent keypair stored by the provider (see Signing Model); the user’s wallet signs on chain 42161.