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

# userFillsByTime | Hyperliquid Info API

> Hyperliquid userFillsByTime: fetch a user’s trade fills within a time window for P&L recaps and tax ledger reconstruction.

<CardGroup cols={2}>
  <Card title="Credit Cost"> 1 per call</Card>
  <Card title="Processing"> Realtime</Card>
</CardGroup>

The Hyperliquid info endpoint with `type: "userFillsByTime"` is used to fetch a user’s trade fills within a time window for P\&L recaps and tax ledger reconstruction.

<Tip>
  Estimate your monthly cost for this API using the [Pricing Calculator](/pricing-calculator?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fuser-fills-by-time).
</Tip>

<Info>
  * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "userFillsByTime", "user": "...", "startTime": ...}`.
  * Each response contains at most 2,000 fills; widen the window in chunks or page by advancing `startTime` if you need more.
  * GoldRush serves this `type` from a dedicated HyperCore historical store, so windows older than upstream Hyperliquid’s 10,000-fill retention are still fulfilled.
  * For real-time push instead of windowed polling, subscribe to <a href="https://goldrush.dev/docs/api-reference/streaming-api/subscriptions/wallet-activity-stream" target="_blank" rel="noopener noreferrer">`walletTxs`</a> and read `HypercoreFillTransaction` events.
  * Use <a href="https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals" target="_blank" rel="noopener noreferrer">`userFills`</a> (no `Time` suffix) when you only need the most recent N fills without specifying a window.
</Info>

Returns a single user’s fills bounded by a `[startTime, endTime)` window in milliseconds. Use this when you want fills since a specific moment - daily P\&L recaps, post-deploy backfills, or rebuilding a tax ledger - rather than the most recent N fills.

User-keyed. The upstream Hyperliquid API caps each response at **2,000 fills**; page by advancing `startTime`. **NOT LIMITED TO THE 10,000 MOST RECENT FILLS.** GoldRush serves this `type` from a dedicated HyperCore historical store so windows extending past the upstream retention limit are fulfilled from GoldRush data rather than truncated.

## Endpoint

```
POST https://hypercore.goldrushdata.com/info
Authorization: Bearer <GOLDRUSH_API_KEY>
Content-Type: application/json
```

## Request

<ParamField body="type" type="string" required default="userFillsByTime">
  Always `"userFillsByTime"`.
</ParamField>

<ParamField body="user" type="string" required>
  The wallet address (lowercase 0x-prefixed hex).
</ParamField>

<ParamField body="startTime" type="int" required>
  Unix timestamp in milliseconds. Inclusive lower bound.
</ParamField>

<ParamField body="endTime" type="int">
  Unix timestamp in milliseconds. Inclusive upper bound. Defaults to current server time when omitted.
</ParamField>

<ParamField body="aggregateByTime" type="boolean">
  When `true`, partial fills sharing the same timestamp are consolidated into one row. Default `false`.
</ParamField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://hypercore.goldrushdata.com/info \
    -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "userFillsByTime",
      "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b",
      "startTime": 1735689600000
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://hypercore.goldrushdata.com/info", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.GOLDRUSH_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      type: "userFillsByTime",
      user: "0x31ca8395cf837de08b24da3f660e77761dfb974b",
      startTime: 1735689600000,
    }),
  });

  const fills = await response.json();
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.post(
      "https://hypercore.goldrushdata.com/info",
      headers={"Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"},
      json={
          "type": "userFillsByTime",
          "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b",
          "startTime": 1735689600000,
      },
  )

  fills = response.json()
  ```
</CodeGroup>

## Response

An array of fill objects ordered by `time`.

```json theme={null}
[
  {
    "coin": "BTC",
    "px": "43250.5",
    "sz": "0.1",
    "side": "B",
    "time": 1735689600000,
    "startPosition": "0",
    "dir": "Open Long",
    "closedPnl": "0",
    "hash": "0x6b9c0a4a3d54b0d4d6b1a0c4d8c9e7f2b6e5d3c2a1f0e9d8c7b6a5f4e3d2c1b0a",
    "oid": 95012345,
    "tid": 678900012345,
    "crossed": true,
    "fee": "2.16",
    "feeToken": "USDC"
  }
]
```

### Field descriptions

<Note>
  All numeric fields (`px`, `sz`, `startPosition`, `closedPnl`, `fee`, `builderFee`) are returned as **decimal strings**, preserving upstream precision. Do not parse them as floats - keep them as strings or use a fixed-precision decimal type.
</Note>

<ResponseField name="coin" type="string">Asset symbol - e.g. `"BTC"`, `"ETH"` for perps; spot pairs use the `@N` form (e.g. `"@107"`).</ResponseField>
<ResponseField name="px" type="string">Fill execution price.</ResponseField>
<ResponseField name="sz" type="string">Fill size.</ResponseField>
<ResponseField name="side" type="string">`"B"` for buy/long, `"A"` for ask/short.</ResponseField>
<ResponseField name="time" type="int">Unix timestamp in milliseconds when the fill executed.</ResponseField>
<ResponseField name="startPosition" type="string">Signed position size on the same coin immediately before this fill.</ResponseField>
<ResponseField name="dir" type="string">Human-readable direction label - e.g. `"Open Long"`, `"Close Short"`, `"Buy"`, `"Sell"`.</ResponseField>
<ResponseField name="closedPnl" type="string">Realized PnL in USDC attributable to this fill (zero when the fill opens or extends a position).</ResponseField>
<ResponseField name="hash" type="string">L1 transaction hash that included this fill.</ResponseField>
<ResponseField name="oid" type="int">Parent order ID.</ResponseField>
<ResponseField name="tid" type="int">Unique trade ID.</ResponseField>
<ResponseField name="crossed" type="boolean">`true` when the fill came from the taker side of the order, `false` when it was the maker side.</ResponseField>
<ResponseField name="fee" type="string">Trading fee paid for this fill, denominated in `feeToken`.</ResponseField>
<ResponseField name="feeToken" type="string">Symbol the fee was paid in - typically `"USDC"`.</ResponseField>
<ResponseField name="builderFee" type="string">Optional. Builder fee paid for this fill if the order routed through a builder code.</ResponseField>
<ResponseField name="twapId" type="int | null">Optional TWAP order ID if this fill is a slice of a TWAP order.</ResponseField>
<ResponseField name="cloid" type="string | null">Optional client order ID if one was set at order placement.</ResponseField>

## Related endpoints

<CardGroup cols={2}>
  <Card title="userTwapSliceFillsByTime" href="/api-reference/hyperliquid-info/user-twap-slice-fills-by-time">fetch a user's TWAP slice fills within a time window for execution-quality reconciliation on algorithmic…</Card>
  <Card title="builderFillsByTime" href="/api-reference/hyperliquid-info/builder-fills-by-time">fetch a builder’s attributed trade fills within a time window for revenue attribution and fee accounting.</Card>
  <Card title="userFills" href="/api-reference/hyperliquid-info/user-fills">fetch a user's most recent trade fills without specifying a time window.</Card>
  <Card title="userTwapSliceFills" href="/api-reference/hyperliquid-info/user-twap-slice-fills">fetch a user's most recent TWAP slice fills for execution-quality analytics on algorithmic orders.</Card>
</CardGroup>

*Last reviewed: 2026-06-16*
