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

# Get User Trades

> List a wallet's fills across the commodity books you can reach

Returns trades where the wallet was maker or taker, newest first, across every commodity book your instance owns or has imported. Fills against a pooled peer in the same fungibility class appear here too, because a trade is recorded against both the maker's and the taker's book.

## Path Parameters

<ParamField path="userAddress" type="string" required>Wallet address. Matched case-insensitively.</ParamField>

## Query Parameters

<ParamField query="limit" type="integer" default="50">Page size, capped at 100.</ParamField>

<ParamField query="offset" type="integer" default="0">Rows to skip.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="trades" type="array">
      <Expandable>
        <ResponseField name="tradeId" type="string">Trade ID.</ResponseField>
        <ResponseField name="orderBookId" type="string">Maker's book.</ResponseField>
        <ResponseField name="takerOrderBookId" type="string">Taker's book when the fill crossed a pooled peer, otherwise `null`.</ResponseField>
        <ResponseField name="origin" type="string">`CLOB`.</ResponseField>
        <ResponseField name="makerAddress" type="string">Resting side.</ResponseField>
        <ResponseField name="takerAddress" type="string">Aggressing side.</ResponseField>
        <ResponseField name="price" type="string">Execution price in order book units.</ResponseField>
        <ResponseField name="quantity" type="string">Base quantity in order book units.</ResponseField>
        <ResponseField name="makerFee" type="string">Fee charged to the maker, as base quantity in order book units.</ResponseField>
        <ResponseField name="takerFee" type="string">Fee charged to the taker, as base quantity in order book units.</ResponseField>
        <ResponseField name="side" type="string">Side of the aggressing order.</ResponseField>
        <ResponseField name="settlementId" type="string">Settlement grouping this trade, or `null`.</ResponseField>
        <ResponseField name="settlementStatus" type="string">`PROCESSING`, `CONFIRMED`, `FAILED`, or `null`.</ResponseField>
        <ResponseField name="settlementError" type="string">Why settlement failed, or `null`.</ResponseField>
        <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
        <ResponseField name="orderBook" type="object">The maker's book record.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="total" type="integer">Total matching trades.</ResponseField>
    <ResponseField name="limit" type="integer">Page size applied.</ResponseField>
    <ResponseField name="offset" type="integer">Offset applied.</ResponseField>
  </Expandable>
</ResponseField>

<Note>
  This list is unfiltered by settlement outcome, so a trade whose settlement failed still appears. The market data reads take the opposite view and exclude failed trades from last price, volume and counts.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/commodities/api/users/0xabc7f1093d5e26b804a1c3f78de025916b47c0d3/trades?limit=50" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/orderbooks/commodities/api/users/${address}/trades?limit=50`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "trades": [
        {
          "tradeId": "b40e7c12-3a86-4d95-8f01-6e2c9a5d7031",
          "orderBookId": "clx_ob_comm_001",
          "takerOrderBookId": "clx_ob_comm_055",
          "origin": "CLOB",
          "makerAddress": "0xabc7f1093d5e26b804a1c3f78de025916b47c0d3",
          "takerAddress": "0x9f8c1d4b2e7a3056c1b8f4d29e0a7c3518b6d24f",
          "price": "2410000000",
          "quantity": "2000000",
          "makerFee": "400",
          "takerFee": "1600",
          "side": "SELL",
          "settlementId": "clx_settle_92",
          "settlementStatus": "CONFIRMED",
          "settlementError": null,
          "createdAt": "2025-06-15T12:02:00.000Z",
          "orderBook": { "id": "clx_ob_comm_001", "symbol": "XAUA" }
        }
      ],
      "total": 1,
      "limit": 50,
      "offset": 0
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                  | HTTP  | Cause                                               |
| --------------------- | ----- | --------------------------------------------------- |
| `VALIDATION_ERROR`    | `400` | `userAddress` is not a valid address                |
| `SERVICE_NOT_ENABLED` | `403` | The Trading service is not enabled on this instance |
