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

# userCompletedTrades | Hyperliquid Info API

> Hyperliquid userCompletedTrades: fetch a wallet's most recent fully-closed round-trip trades, newest-first, each with realized PnL, funding, fees, and volume-weighted entry/exit prices.

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

The Hyperliquid info endpoint with `type: "userCompletedTrades"` is used to fetch a wallet's most recent fully-closed round-trip trades, newest-first, each with realized PnL, funding, fees, and volume-weighted entry/exit prices.

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

<Info>
  * GoldRush custom analytics product. **Not available on the public Hyperliquid node** - there is no `POST api.hyperliquid.xyz/info` equivalent. Served only from `POST hypercore.goldrushdata.com/info`.
  * Each record is one **fully-closed round-trip position** (opened, then brought fully flat), reconstructed from the wallet's fills. Positions that are still open are not included.
  * Returns up to `limit` records, newest-first (default `100`, max `500`).
  * For a `close_time` window with forward paging, use <a href="https://goldrush.dev/docs/api-reference/hyperliquid-info/user-completed-trades-by-time" target="_blank" rel="noopener noreferrer">`userCompletedTradesByTime`</a>. For one aggregate roll-up across all a wallet's trades, use <a href="https://goldrush.dev/docs/api-reference/hyperliquid-info/user-pnl-summary" target="_blank" rel="noopener noreferrer">`userPnlSummary`</a>.
</Info>

Returns the latest `limit` fully-closed round-trip trades for a wallet, ordered newest-first by close time. Each row rolls up every fill that opened and then fully closed a position on one coin into a single record - realized gross and net PnL, the funding component, volume-weighted entry and exit prices, fees, fill counts, and the open/close timestamps. Use this when you want a wallet's recent trading outcomes without stepping through raw fills.

User-keyed. GoldRush-native, so there is no upstream Hyperliquid `/info` equivalent.

## Endpoint

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

## Request

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

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

<ParamField body="builder" type="string">
  Optional filter. When set, returns only trades whose closing fill was routed through this builder address (`0x`-prefixed 42-character hex).
</ParamField>

<ParamField body="dex" type="string">
  Optional perp-DEX scope. `main_dex` for the canonical Hyperliquid perp DEX, or a HIP-3 DEX identifier. Omit to include trades across every DEX.
</ParamField>

<ParamField body="limit" type="int">
  Maximum number of records to return. Default `100`, maximum `500`. Values above the maximum are clamped.
</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": "userCompletedTrades",
      "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b",
      "limit": 100
    }'
  ```

  ```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: "userCompletedTrades",
      user: "0x31ca8395cf837de08b24da3f660e77761dfb974b",
      limit: 100,
    }),
  });

  const trades = 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": "userCompletedTrades",
          "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b",
          "limit": 100,
      },
  )

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

## Response

An array of completed-trade objects, newest-first by `close_time`.

```json theme={null}
[
  {
    "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b",
    "coin": "BTC",
    "position_type": "Long",
    "gross_pnl": "505.25",
    "net_pnl": "498.11",
    "funding_pnl": "0.98",
    "entry_px": "63642.5",
    "exit_px": "64150.75",
    "position_closed_size": "1.0171",
    "fees": "8.12",
    "fills": 12,
    "open_time": 1735689600000,
    "close_time": 1735776000000,
    "duration_ms": 86400000,
    "max_position_size": "1.0171",
    "maker_fills": 4,
    "builder": null
  }
]
```

### Field descriptions

<Note>
  The PnL, price, size, and fee fields (`gross_pnl`, `net_pnl`, `funding_pnl`, `entry_px`, `exit_px`, `position_closed_size`, `fees`, `max_position_size`) are returned as **decimal strings**, preserving full precision. Counts (`fills`, `maker_fills`) and timestamps (`open_time`, `close_time`, `duration_ms`) are JSON numbers. Do not parse the decimal strings as floats - keep them as strings or use a fixed-precision decimal type.
</Note>

<ResponseField name="user" type="string">The wallet address the trades belong to (lowercase 0x-prefixed hex), echoing the request.</ResponseField>
<ResponseField name="coin" type="string">Asset symbol - e.g. `"BTC"`, `"ETH"` for perps; HIP-3 markets use the `dex:SYM` form (e.g. `"xyz:GOLD"`).</ResponseField>
<ResponseField name="position_type" type="string">Direction of the round-trip position - `"Long"` or `"Short"`.</ResponseField>
<ResponseField name="gross_pnl" type="string">Realized trading PnL for the round-trip in USDC, before fees and funding.</ResponseField>
<ResponseField name="net_pnl" type="string">Net realized PnL in USDC - `gross_pnl` minus `fees` plus `funding_pnl`.</ResponseField>
<ResponseField name="funding_pnl" type="string">Funding component of the round-trip in USDC (negative = paid, positive = received).</ResponseField>
<ResponseField name="entry_px" type="string">Volume-weighted average entry price across the opening fills (carried at 10 decimal places, then trimmed of trailing zeros).</ResponseField>
<ResponseField name="exit_px" type="string">Volume-weighted average exit price across the closing fills (carried at 10 decimal places, then trimmed of trailing zeros).</ResponseField>
<ResponseField name="position_closed_size" type="string">Peak absolute position size reached during the round-trip - the same value as `max_position_size`.</ResponseField>
<ResponseField name="fees" type="string">Total trading fees paid across all fills in the round-trip, in USDC.</ResponseField>
<ResponseField name="fills" type="int">Total number of fills that make up the round-trip (opening and closing).</ResponseField>
<ResponseField name="open_time" type="int">Unix timestamp in milliseconds of the first opening fill.</ResponseField>
<ResponseField name="close_time" type="int">Unix timestamp in milliseconds of the closing fill that brought the position flat.</ResponseField>
<ResponseField name="duration_ms" type="int">Round-trip duration in milliseconds - `close_time` minus `open_time`.</ResponseField>
<ResponseField name="max_position_size" type="string">Peak absolute position size reached during the round-trip.</ResponseField>
<ResponseField name="maker_fills" type="int">Number of fills in the round-trip that were on the maker side.</ResponseField>
<ResponseField name="builder" type="string | null">Builder address routed through by the closing fill (`0x`-prefixed hex), or `null` when the closing fill carried no builder code.</ResponseField>

## Related endpoints

<CardGroup cols={2}>
  <Card title="userCompletedTradesByTime" href="/docs/api-reference/hyperliquid-info/user-completed-trades-by-time">fetch a wallet's fully-closed round-trip trades within a time window, oldest-first with a keyset cursor for forward paging.</Card>
  <Card title="userPnlSummary" href="/docs/api-reference/hyperliquid-info/user-pnl-summary">fetch one aggregate PnL summary for a wallet - realized PnL, win/loss rate, volume, fees, funding, and traded pairs.</Card>
  <Card title="userFills" href="/docs/api-reference/hyperliquid-info/user-fills">fetch a user's most recent trade fills without specifying a time window.</Card>
  <Card title="userFunding" href="/docs/api-reference/hyperliquid-info/user-funding">fetch a user's per-coin funding payment history within a time window for funding-only P\&L attribution.</Card>
</CardGroup>

See all Hyperliquid endpoints: [Overview hub](/docs/goldrush-hyperliquid/overview) · [Info API reference](/docs/goldrush-hyperliquid/info-api/overview)

*Last reviewed: 2026-08-17*
