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

# Get Trades

> Get trade history for a user's SDK trades.

Requires API key in Authorization header.

- venue='all' (default): merged trades across sim_trades + real_trades, sorted by created_at desc
- venue='sim': queries sim_trades table (simulated LMSR trades)
- venue='polymarket': queries real_trades table (real Polymarket trades)
- venue='kalshi': queries real_trades table filtered to Kalshi trades

Optional filters (all backward-compatible):
- market_id: restrict to one market
- since / until: ISO-8601 datetime range filter on created_at
- include_failed: when true, widens real_trades to also return failed/cancelled/expired rows.
  Each such row carries failure_category (normalized bucket) and failure_reason (sanitized message).
  superseded rows are always excluded.

Each trade row includes a `venue` field identifying which venue it came from.

Deprecated: venue='sandbox'/'simmer' are deprecated, use venue='sim' instead.

Returns trades from the user's wallet (rate limited: 300/minute).

<Tip>
  **Cross-venue by default.** `venue` defaults to `all`, returning merged `sim_trades` + `real_trades` sorted by `created_at desc`. Each row is tagged with a `venue` field. Pass `?venue=sim|polymarket|kalshi` to filter to a single venue.
</Tip>


## OpenAPI

````yaml /openapi.json get /api/sdk/trades
openapi: 3.1.0
info:
  title: Simmer API
  description: Agent-native trading infrastructure for prediction markets.
  version: 1.0.0
servers:
  - url: https://api.simmer.markets
security: []
paths:
  /api/sdk/trades:
    get:
      summary: Get Trades
      description: >-
        Get trade history for a user's SDK trades.


        Requires API key in Authorization header.


        - venue='all' (default): merged trades across sim_trades + real_trades,
        sorted by created_at desc

        - venue='sim': queries sim_trades table (simulated LMSR trades)

        - venue='polymarket': queries real_trades table (real Polymarket trades)

        - venue='kalshi': queries real_trades table filtered to Kalshi trades


        Optional filters (all backward-compatible):

        - market_id: restrict to one market

        - since / until: ISO-8601 datetime range filter on created_at

        - include_failed: when true, widens real_trades to also return
        failed/cancelled/expired rows.
          Each such row carries failure_category (normalized bucket) and failure_reason (sanitized message).
          superseded rows are always excluded.

        Each trade row includes a `venue` field identifying which venue it came
        from.


        Deprecated: venue='sandbox'/'simmer' are deprecated, use venue='sim'
        instead.


        Returns trades from the user's wallet (rate limited: 300/minute).
      operationId: api_sdk_get_trades_api_sdk_trades_get
      parameters:
        - name: venue
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Venue filter: 'all' (default — sim + polymarket merged), 'sim',
              'polymarket', or 'kalshi'
            default: all
            title: Venue
          description: >-
            Venue filter: 'all' (default — sim + polymarket merged), 'sim',
            'polymarket', or 'kalshi'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Max trades to return
            default: 50
            title: Limit
          description: Max trades to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Offset for pagination
            default: 0
            title: Offset
          description: Offset for pagination
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter trades to a specific SDK agent ID (sim trades only)
            title: Agent Id
          description: Filter trades to a specific SDK agent ID (sim trades only)
        - name: market_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter to a specific market ID (UUID); applies to both sim and
              real trades
            title: Market Id
          description: >-
            Filter to a specific market ID (UUID); applies to both sim and real
            trades
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO-8601 datetime: include trades at or after this time (e.g.
              2025-01-01T00:00:00Z)
            title: Since
          description: >-
            ISO-8601 datetime: include trades at or after this time (e.g.
            2025-01-01T00:00:00Z)
        - name: until
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'ISO-8601 datetime: include trades at or before this time'
            title: Until
          description: 'ISO-8601 datetime: include trades at or before this time'
        - name: include_failed
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Include failed/cancelled/expired trades (default false). Failed
              rows carry failure_category and failure_reason fields.
            default: false
            title: Include Failed
          description: >-
            Include failed/cancelled/expired trades (default false). Failed rows
            carry failure_category and failure_reason fields.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````