@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’s access state as a value. The other reads throw it as a typed PerpsError. See Account access for the codes and what to render for each.
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 withconfig.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.getAccount()
getPositions
Returns the user’s open positions. Hyperliquid and Lighter return every open position in one response (hasMore: false); limit and cursor are hints for providers that page.
Parameters
Shape
Position fields
MarketDisplay
TheMarketDisplay object is used across positions, orders, fills, and activity to identify the market and its underlying assets:
SDK:
getPositions()
getOrders
Returns the user’s orders as a singleOrder union: regular (MARKET, LIMIT), trigger, and TWAP orders. By default only active orders are returned; pass statuses to read order history.
Parameters
Shape
orders is an array of Order = RegularOrder | TriggerOrder | TwapOrder, discriminated on type.
Order fields (all variants)
RegularOrder fields
type is MARKET or LIMIT.
TriggerOrder fields
type is STOP_MARKET, STOP_LIMIT, TAKE_PROFIT_MARKET, or TAKE_PROFIT_LIMIT.
TwapOrder fields
type is TWAP. TWAP parents are read-only.
OrderType
MARKET, LIMIT, STOP_MARKET, STOP_LIMIT, TAKE_PROFIT_MARKET, TAKE_PROFIT_LIMIT, TWAP. TWAP appears on reads only; placement types exclude it. Provider support for each placement type is listed under placeOrder.
OrderStatus
SDK:
getOrders()
getFills
Returns paginated order fills. Results are sorted by creation time, newest first.Parameters
Shape
ThefilledSize, fee, and realizedPnl fields are optional. realizedPnl is null when the fill 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 thecursor from the response to fetch the next page:
hasMore is false, there are no more pages.
SDK: getFills()
getActivity
Returns paginated account activity: deposits, withdrawals, transfers, liquidations, and funding payments.Parameters
Shape
The response contains a discriminated union of activity items — thetype field determines which fields are present.
Activity Types
All activity items share these base fields:
DEPOSIT — Funds deposited into the provider account:
WITHDRAWAL — Funds withdrawn from the provider account:
FUNDING — Funding payment received or paid on an open position:
LIQUIDATION — Position(s) liquidated:
Each
LiquidatedPosition:
TRANSFER — Transfer between two accounts on the same provider, emitted by Hyperliquid (identified by
counterpartyAddress) and Lighter (identified by counterpartyAccountIndex). 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 thecursor from the response to fetch the next page:
hasMore is false, there are no more pages.
SDK: getActivity()