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

# Trades

> Get recent executed trades (CLOB markets only)

## Authentication

No authentication required.

## Query parameters

<ParamField query="marketId" type="string">
  Filter by market UUID.
</ParamField>

<ParamField query="id" type="string">
  Filter to a specific trade UUID.
</ParamField>

<ParamField query="orderId" type="string">
  Filter by order UUID. Matches trades where the order is on either the taker or maker side.
</ParamField>

<ParamField query="outcomeId" type="string">
  Filter by outcome UUID. Matches trades on either the taker or maker side.
</ParamField>

<ParamField query="userId" type="string">
  Filter by user UUID. Matches trades where the user was either the taker or the maker.
</ParamField>

<ParamField query="fromDate" type="string">
  Only return trades created at or after this RFC3339 timestamp (e.g. `2026-02-17T00:00:00Z`).
</ParamField>

<ParamField query="toDate" type="string">
  Only return trades created at or before this RFC3339 timestamp (e.g. `2026-02-17T23:59:59Z`).
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number (1-indexed).
</ParamField>

<ParamField query="size" type="integer" default="50">
  Number of trades per page (max 100).
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://relay.bayse.markets/v1/pm/trades?marketId=b2c3d4e5-f6a7-8901-bcde-f12345678901&page=1&size=20"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://relay.bayse.markets/v1/pm/trades?marketId=b2c3d4e5-f6a7-8901-bcde-f12345678901&page=1&size=20'
  );
  const { data, pagination } = await response.json();
  ```

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

  resp = requests.get(
      'https://relay.bayse.markets/v1/pm/trades',
      params={
          'marketId': 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
          'page': 1,
          'size': 20,
      },
  )
  body = resp.json()
  trades = body['data']
  pagination = body['pagination']
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://relay.bayse.markets/v1/pm/trades", nil)
  q := req.URL.Query()
  q.Add("marketId", "b2c3d4e5-f6a7-8901-bcde-f12345678901")
  q.Add("page", "1")
  q.Add("size", "20")
  req.URL.RawQuery = q.Encode()
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

Returns a paginated list of recently executed trades, most recent first. Trades
are in `data`, with pagination metadata in `pagination`.

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": [
      {
        "id": "t1a2b3c4-d5e6-7890-abcd-ef1234567890",
        "marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "outcome": "YES",
        "price": 0.72,
        "size": 100,
        "createdAt": "2026-02-17T12:00:01Z"
      },
      {
        "id": "t2b3c4d5-e6f7-8901-bcde-f12345678901",
        "marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "outcome": "NO",
        "price": 0.28,
        "size": 250,
        "createdAt": "2026-02-17T11:59:45Z"
      }
    ],
    "pagination": {
      "page": 1,
      "size": 20,
      "totalCount": 2,
      "lastPage": 1
    }
  }
  ```
</ResponseExample>

<Note>
  This endpoint returns trades from CLOB markets only. AMM market trades are not included.
</Note>
