Order[] list. By default it returns active orders; pass statuses to read order history.
The examples on this page use Hyperliquid (
provider: 'hyperliquid'). Replace the provider value with any supported provider from getProviders().Parameters
Hyperliquid
getOrders is not paginated. Lighter pages order history at 100 items.
Order history
Pass terminal statuses to read historical orders. Hyperliquid readshistoricalOrders; Lighter reads accountInactiveOrders. TWAP parents are always fetched and filtered by statuses.
Returns
OrdersResponse:
Narrow the union with
isRegularOrder, isTriggerOrder and isTwapOrder, all exported from @lifi/perps-sdk.
Order fields
Every order carries these fields:RegularOrder (type is MARKET or LIMIT) adds:
TriggerOrder (type is a stop or take-profit type) adds:
TwapOrder (type is TWAP) adds:
OrderType
Reading TWAP orders
TWAP parents are returned bygetOrders as TwapOrders. There is no separate TWAP read. Filter with isTwapOrder; the parent’s orderId is the twapId that cancelTwapOrder expects.
OPEN or PARTIALLY_FILLED; a finished one is FILLED, a terminated one CANCELLED, and an errored one REJECTED. Child orders carry the parent’s id in parentOrderId. See TWAP Orders for cancelling.
To look up a single order by id rather than listing orders, use
getOrder() (see Order Status). On Lighter, getOrder() accepts a client_order_index-prefixed id built from a placed order’s clientOrderIndex — see Lighter / Trading.Throws
PerpsError with one code for the account’s access state. See Account access.
SetupRequired— the venue needs a credential (a Lighter auth token or an Ondo session) and none is stored.Unauthorized— the venue rejects the credential.AccountNotFound— the wallet has no venue account.
orders list.
Data shapes: getOrders — a direct-to-provider read, not a LI.FI HTTP endpoint.