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.market.baseAsset.displaySymbol, order.side, order.type, order.price);
}
for (const trigger of result.triggerOrders) {
console.log(trigger.market.baseAsset.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.marketId | string | No | Filter by the canonical Market.id (not display symbol) |
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 |
|---|
orderId | string | Order ID |
market | MarketDisplay | Market identity. Display symbol is market.baseAsset.displaySymbol. |
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 |
|---|
orderId | string | Order ID |
market | MarketDisplay | Market identity. Display symbol is market.baseAsset.displaySymbol. |
type | OrderType | Trigger order type (e.g., TAKE_PROFIT_MARKET, STOP_LIMIT) — see OrderType |
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 |
OrderType
| Value | Description |
|---|
MARKET | Market order — executes immediately at the best available price |
LIMIT | Limit order — rests until filled, cancelled, or expired |
STOP_MARKET | Stop-market — converts to a market order when the trigger price is hit |
STOP_LIMIT | Stop-limit — converts to a limit order when the trigger price is hit |
TAKE_PROFIT_MARKET | Take-profit market order |
TAKE_PROFIT_LIMIT | Take-profit limit order |
TRIGGER_ONLY | Trigger-only order (provider-specific; e.g., Lighter’s bare-trigger marker for orders whose final type is decided when the trigger fires) |
API Reference: GET /orders