> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ostium.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getOpenOrders

> Fetch active Ostium limit orders for a trader.

```ts theme={null}
const orders = await client.getOpenOrders();
```

In read-only mode:

```ts theme={null}
await client.getOpenOrders({ user: '0xTraderAddress' });
```

Use `pairId` and `idx` from this response with `modifyOrder()` and `cancelOrder()`.

`idx` is the on-chain limit-order slot index within the trader and pair, not the global order id from the subgraph. Pass it directly with `pairId` when cancelling or modifying a limit or stop order.

## Response schema

```ts theme={null}
type Response = Array<{
  pairTo: string;
  pairFrom: string;
  pairId: string;
  trader: string;
  idx: number;
  side: 'B' | 'S';
  limitPx: string;
  szi: string;
  orderType: string;
  tpPx?: string;
  slPx?: string;
  timestamp: number;
}>;
```
