Skip to main content
Account-level reads — account summary, positions, orders, fills, activity, and single-order lookup — are served by the SDK directly from each provider via @lifi/perps-sdk (getAccount, getPositions, getOrders, getFills, getActivity, getOrder). They are not LI.FI HTTP endpoints. This page documents the data shapes those calls return.

getAccount

Returns the account summary including balances, margin, and fee tier.

Parameters

Shape

AccountResponse fields

AccountConfig

Discriminated union of per-provider account configuration state. Narrow with config.provider === '<key>' to access provider-specific fields. Hyperliquid (provider: "hyperliquid"): Lighter (provider: "lighter"): Ondo (provider: "ondo"):
The response positions array mirrors the unfiltered getPositions output. Orders are fetched separately: getOrders.
SDK: getAccount()

getPositions

Returns the user’s open positions. Results are paginated.

Parameters

Shape

Position fields

MarketDisplay

The MarketDisplay object is used across positions, orders, fills, and activity to identify the market and its underlying assets: SDK: getPositions()

getOrders

Returns the user’s open orders and trigger orders. Results are paginated.

Parameters

Shape

OpenOrder fields

TriggerOrder fields

SDK: getOrders()

getFills

Returns paginated order fills. Results are sorted by creation time, newest first.

Parameters

Shape

The filledSize, fee, and realizedPnl fields are optional — they may be absent on cancelled or rejected orders, and realizedPnl is null when the order did not close a position.

Fill fields

FillClassification

Describes how the fill affected the user’s position. Wire values are Title Case strings:

Pagination

Use the cursor from the response to fetch the next page:
When hasMore is false, there are no more pages. SDK: getFills()

getActivity

Returns paginated account activity: deposits, withdrawals, liquidations, and funding payments.

Parameters

Shape

The response contains a discriminated union of activity items — the type field determines which fields are present.

Activity Types

All activity items share these base fields: DEPOSIT — Funds deposited into the DEX account: WITHDRAWAL — Funds withdrawn from the DEX account: FUNDING — Funding payment received or paid on an open position: LIQUIDATION — Position(s) liquidated: Each LiquidatedPosition: TRANSFER — Internal transfer between two accounts on the same provider (currently emitted by Lighter only; the type definition supports Hyperliquid as well). Direction is relative to the queried account. The counterparty is identified by either an account index (integer L2 account identifier — Lighter) or a wallet address (Hyperliquid, where accounts ARE addresses). The shape is a discriminated union: at least one of counterpartyAccountIndex / counterpartyAddress MUST be present, and either may appear alone or alongside the other. Consumers that render counterparties should prefer counterpartyAccountIndex when present (canonical handle on index-based providers) and fall back to a truncated counterpartyAddress otherwise.

Pagination

Use the cursor from the response to fetch the next page:
When hasMore is false, there are no more pages. SDK: getActivity()