Returns the user’s open orders and trigger orders, paginated.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().
import { getOrders } from '@lifi/perps-sdk';
const result = await getOrders(client, {
provider: 'hyperliquid',
address: userAddress,
});
for (const order of result.openOrders) {
console.log(order.asset.displaySymbol, order.side, order.type, order.price);
}
for (const trigger of result.triggerOrders) {
console.log(trigger.asset.displaySymbol, trigger.type, trigger.triggerPrice);
}
Parameters
| Parameter | Type | Required | Description |
|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | DEX identifier |
params.address | string | Yes | User’s wallet address |
params.symbol | string | No | Filter by asset identifier |
params.limit | number | No | Items per page (default 50, max 100) |
params.cursor | string | No | Pagination cursor from previous response |
options | SDKRequestOptions | No | Request options |
Returns
OrdersResponse:
| Field | Type | Description |
|---|
provider | string | Provider identifier |
openOrders | OpenOrder[] | Resting limit orders |
triggerOrders | TriggerOrder[] | Pending trigger orders (TP/SL) |
pagination | Pagination | Pagination metadata |
OpenOrder fields
| Field | Type | Description |
|---|
id | string | Order ID |
asset | AssetDisplay | Asset identity |
side | 'BUY' | 'SELL' | Order direction |
type | OrderType | Order type |
size | string | Order size |
price | string | Limit price |
filledSize | string | Amount filled |
reduceOnly | boolean | Whether reduce-only |
label | string? | Optional order label |
createdAt | string | ISO 8601 timestamp |
TriggerOrder fields
| Field | Type | Description |
|---|
id | string | Order ID |
asset | AssetDisplay | Asset identity |
type | OrderType | Trigger order type (e.g., TAKE_PROFIT_MARKET, STOP_LIMIT) |
size | string | Order size |
triggerPrice | string | Price at which the order activates |
limitPrice | string? | Execution limit price (market order if omitted) |
label | string? | Optional order label |
createdAt | string | ISO 8601 timestamp |
API Reference: GET /orders