Skip to main content
Returns the account summary for a provider including balances, margin, and fee tier.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Replace the provider value with any supported provider from getProviders().

Parameters

Returns

AccountResponse: Each Balance:
The positions array mirrors the unfiltered getPositions() output. Orders are fetched separately via getOrders().

Throws

Hyperliquid getAccount throws AccountNotFound when preTransferCheck.userExists is false, before reading account data. Lighter getAccount throws the same code when the wallet has no Lighter account and Unauthorized when Lighter rejects the resolved token used for its fee-tier read. Ondo getAccount remains a status read and returns its logged-out account value without a session. See Account access for the provider-specific status-read and data-read contract.

PerpsClient.getAccount

The PerpsClient method wraps the standalone getAccount and additionally resolves the account’s setting descriptors. It returns a GetAccountResult — every AccountResponse field plus a settings array.

PerpsClient.getAccountSummary

Derives portfolio-level totals from an already-fetched account snapshot and its positions. Pure computation — makes no network request.
Returns: AccountSummary: Each provider reads these figures from its own venue fields. See Hyperliquid, Ondo, and Lighter for the exact source of each value on that venue. To size an order on one market, read getAvailableToTrade() instead. availableMargin stays account-scoped. getAvailableToTrade() returns the per-market amount an order panel needs.

accountExists

Thin existence check for a provider account at address — useful for gating signing-mode or onboarding flows on whether the user has any account state with the provider yet.
Returns: Promise<boolean> — the SDK delegates the check to the registered provider plugin’s own accountExists probe. Each provider defines the probe differently: Hyperliquid checks preTransferCheck.userExists; Ondo sends an authenticated /v1/account request and returns false when there is no session. The method throws when no plugin is registered for provider, or when the plugin’s probe itself fails.
Venue reads can lag a write (order placement, updateLeverage, sendAsset, margin updates) by a couple of seconds. After a write, apply the change optimistically and re-read once after a short delay instead of immediately. See Streaming.
Data shapes: getAccount — a direct-to-provider read, not a LI.FI HTTP endpoint.