> ## 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.

# getLimitOrderHistory

> Fetch a trader's limit and stop order events, including orders that are no longer open.

```ts theme={null}
const events = await client.getLimitOrderHistory();
```

Only cancels, last 50:

```ts theme={null}
const cancels = await client.getLimitOrderHistory({ events: ['Canceled'], limit: 50 });
```

Returns limit and stop order events — `Placed`, `Updated` (re-priced), `Canceled`, `Executed` — newest first. A cancelled limit creates no order row, so neither [getOpenOrders](/developer/reference/get-open-orders.md) nor [getOrders](/developer/reference/get-orders.md) shows it; this does.

On `OstiumClient`, `user` defaults to the connected trader.

## Parameters

```ts theme={null}
interface GetLimitOrderHistoryParams {
  user?: `0x${string}`;
  events?: Array<'Placed' | 'Updated' | 'Canceled' | 'Executed'>; // defaults to all four
  limit?: number;                                                  // defaults to 100
}
```

`limit` must be a positive integer.

## Response schema

```ts theme={null}
type Response = Array<{
  event: 'Placed' | 'Updated' | 'Canceled' | 'Executed';
  limitId: string;          // limit slot: `<trader>_<pairId>_<idx>`
  pairTo: string;
  pairFrom: string;
  pairId: string;
  trader: string;
  idx: number;              // slot index, what cancelOrder / modifyOrder take
  limitPx: string;          // trigger price after this event; on Executed, the fill price
  collateralUsed?: string;  // omitted on Updated
  leverage?: string;        // omitted on Updated
  ntl?: string;             // omitted on Updated
  side?: 'B' | 'S';
  orderType?: 'Limit' | 'Stop';
  oid?: string;             // on Executed, the opening fill's oid
  hash: string;
  block: string;
  timestamp: number;        // Unix seconds UTC
}>;
```

## Reading one order's history

A slot is reused once its order ends, so one order's history runs from a `Placed` event to the next `Canceled` or `Executed` on the same `limitId`. On `Executed`, `limitId` matches `Fill.limitId` on the position it opened, and `oid` matches that fill's `oid`.

* `Updated` events only re-price, so they carry no size fields.
* The subgraph keeps side and order type only for the order currently in each slot, so `side` and `orderType` are omitted on events from earlier orders in a reused slot.
* Events the indexer has not linked to a slot are left out rather than reported as slot 0.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.