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

# Hyperliquid Get Order History

Get recent trade fills and resting orders for a Hyperliquid account. Returns fill history (size, price, PnL, fees) and resting orders for the requested DEX (defaults to crypto perps; pass `dex` for HIP-3 venues). Ideal for: trade journal tracking, fill alerts, order monitoring, and portfolio analytics.

![Hyperliquid Get Order History logo](https://cdn.b3.fun/hyperliquid-logo.png)
Catalog action Hyperliquid

Get recent trade fills and resting orders for a Hyperliquid account. Returns fill history (size, price, PnL, fees) and resting orders for the requested DEX (defaults to crypto perps; pass `dex` for HIP-3 venues). Ideal for: trade journal tracking, fill alerts, order monitoring, and portfolio analytics.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `hyperliquid-get-order-history` |
| Category | Hyperliquid |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `hyperliquid`, `perps`, `order`, `history`, `trade`, `trading` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | `string` | No | Hyperliquid account address \(0x...\) to query. When omitted the connected wallet address is used. |
| `startTime` | `number` | No | Unix timestamp in milliseconds. When provided, fills are queried via userFillsByTime \(supports endTime\). Omit for the most recent userFills response \(Hyperliquid caps this at ~2000\). |
| `endTime` | `number` | No | Unix timestamp in milliseconds. Upper bound for fills, applied only when startTime is set. Ignored if startTime is omitted. |
| `limit` | `number` | No | Maximum number of fills to return after sorting \(newest first\). Defaults to 500, hard cap 2000. openOrders are never truncated. |
| `dex` | `string` | No | HIP-3 DEX name for TradFi markets. Omit for standard crypto perps. xyz = trade.xyz \(stocks, indices, commodities\), flx = flx.finance, vntl = vntl.exchange |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `object` | No | Set when one of the two upstream calls \(fills, openOrders\) fails. The successful side still returns data; the failed side is an empty array. Both failing surfaces a hard error instead. |
| `fills` | `array` | Yes | Recent trade fills sorted by time \(newest first\), capped by limit |
| `openOrders` | `array` | Yes | Currently resting orders for the requested DEX, sorted by timestamp \(newest first\) |

## Examples

**Workflow node**

```json
{
  "type": "hyperliquid-get-order-history",
  "payload": {
    "address": "0x0000000000000000000000000000000000000000",
    "startTime": 1,
    "endTime": 1,
    "limit": 1,
    "dex": "xyz"
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/hyperliquid-get-order-history/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "address": "0x0000000000000000000000000000000000000000",
    "startTime": 1,
    "endTime": 1,
    "limit": 1,
    "dex": "xyz"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.