> ## Documentation Index
> Fetch the complete documentation index at: https://pmxt-sync-hosted-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch My Trades

> List the wallet's historical fills on Polymarket, Opinion, and Limitless. Each trade carries the executed price (net of venue fees), size, and on-chain settlement tx hash.

Closed orders are modelled as trades in hosted mode — use this endpoint instead of `fetchClosedOrders` / `fetchAllOrders` (which raise `NotSupported`).

<Info>
  **Available on:** Polymarket, Opinion, Limitless. Other venues raise `NotSupported` in hosted mode — for those, run a [local PMXT service](/guides/self-hosted).
</Info>

<Tip>
  Use any EVM private key. Your USDC sits in a non-custodial PreFundedEscrow on Polygon — for Polymarket, Opinion, and Limitless. PMXT cannot move funds without your EIP-712 signature.
</Tip>


## OpenAPI

````yaml /api-reference/openapi-hosted-trading.json get /v0/user/{address}/trades
openapi: 3.0.0
info:
  title: PMXT Hosted Router API
  description: Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.
  version: 49fbcd4
servers:
  - url: https://trade.pmxt.dev
    description: Hosted trading (v0)
security:
  - bearerAuth: []
tags:
  - name: Trading (Hosted)
    description: >-
      Hosted trading endpoints. Build / submit / cancel orders via
      `trade.pmxt.dev/v0/*`. Hosted-mode is the default when `pmxt_api_key` is
      set.
  - name: Orders & Positions (Hosted)
    description: >-
      Hosted account reads. Open orders, fills, balances, and positions via
      `trade.pmxt.dev/v0/*`. Requires `pmxt_api_key` + `wallet_address`.
  - name: MatchedMarkets
    description: Cross-venue matched market and event clusters.
  - name: SQL
    description: Direct read-only SQL access to the catalog (Enterprise).
paths:
  /v0/user/{address}/trades:
    get:
      tags:
        - Orders & Positions
      summary: Fetch My Trades
      description: >-
        List the wallet's historical fills on Polymarket, Opinion, and
        Limitless. Each trade carries the executed price (net of venue fees),
        size, and on-chain settlement tx hash.


        Closed orders are modelled as trades in hosted mode — use this endpoint
        instead of `fetchClosedOrders` / `fetchAllOrders` (which raise
        `NotSupported`).
      operationId: fetchMyTradesHosted
      parameters:
        - in: path
          name: address
          required: true
          schema:
            type: string
          description: EVM wallet address.
      responses:
        '200':
          description: Trade history.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserTradeV0'
        '401':
          description: Invalid or missing PMXT API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedErrorResponse'
      x-codeSamples:
        - lang: python
          label: Polymarket
          source: >
            # Hosted reads need: pmxt_api_key + wallet_address (private_key is
            only required for writes).

            import pmxt


            client = pmxt.Polymarket(
                pmxt_api_key="YOUR_PMXT_API_KEY",
                wallet_address="0xYourWallet",
            )

            for trade in client.fetch_my_trades():
                print(trade.id, trade.side, trade.amount, trade.price, trade.tx_hash)
        - lang: javascript
          label: Polymarket
          source: >
            // Hosted reads need: pmxtApiKey + walletAddress (privateKey is only
            required for writes).

            import { Polymarket } from "pmxtjs";


            const client = new Polymarket({
              pmxtApiKey: "YOUR_PMXT_API_KEY",
              walletAddress: "0xYourWallet",
            });


            for (const trade of await client.fetchMyTrades()) {
              console.log(trade.id, trade.side, trade.amount, trade.price, trade.txHash);
            }
        - lang: python
          label: Opinion
          source: >
            # Hosted reads need: pmxt_api_key + wallet_address (private_key is
            only required for writes).

            import pmxt


            client = pmxt.Opinion(
                pmxt_api_key="YOUR_PMXT_API_KEY",
                wallet_address="0xYourWallet",
            )

            for trade in client.fetch_my_trades():
                print(trade.id, trade.side, trade.amount, trade.price, trade.tx_hash)
        - lang: javascript
          label: Opinion
          source: >
            // Hosted reads need: pmxtApiKey + walletAddress (privateKey is only
            required for writes).

            import { Opinion } from "pmxtjs";


            const client = new Opinion({
              pmxtApiKey: "YOUR_PMXT_API_KEY",
              walletAddress: "0xYourWallet",
            });


            for (const trade of await client.fetchMyTrades()) {
              console.log(trade.id, trade.side, trade.amount, trade.price, trade.txHash);
            }
components:
  schemas:
    UserTradeV0:
      type: object
      description: Hosted-mode `UserTrade` shape. Mirrors `pmxt.UserTrade`.
      properties:
        id:
          type: string
          nullable: true
          description: >-
            Venue-issued trade id. `null` when the venue does not expose a
            stable id for this fill.
        side:
          type: string
          enum:
            - buy
            - sell
          nullable: true
          description: Direction of the fill from the wallet's perspective.
        amount:
          type: number
          nullable: true
          description: >-
            Shares filled by this trade (`fill.shares` from the operator's fill
            record).
        price:
          type: number
          nullable: true
          description: >-
            Net average fill price, in probability units [0, 1] -- already
            includes per-fill venue fees (`fill.avg_price_net`).
        fee:
          type: number
          nullable: true
          description: >-
            Sum of all fee components on the fill (venue + PMXT), in USDC
            dollars. `null` when the operator did not record fee components.
        timestamp:
          type: string
          nullable: true
          description: ISO-8601 timestamp of the trade as recorded by the operator.
        tx_hash:
          type: string
          nullable: true
          description: >-
            Polygon settlement transaction hash. Prefers the settlement-tx hash
            when present; falls back to the first underlying fill transaction.
        chain:
          type: string
          nullable: true
          description: Chain the fill settled on (typically `polygon`).
        venue:
          type: string
          enum:
            - polymarket
            - opinion
            - limitless
          nullable: true
          description: Source venue that produced the fill.
    HostedErrorResponse:
      type: object
      description: >-
        Error envelope returned by `trade.pmxt.dev/v0/*` endpoints. Mirrors the
        `ErrorDetail` shape used inside `BaseResponse.error` from the sidecar
        spec.
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error envelope. Always present on non-2xx responses.
          properties:
            message:
              type: string
              description: Human-readable explanation safe to surface to end users.
            code:
              type: string
              description: >-
                Stable hosted-mode error code. Use this (not `message`) for
                branching in client code.
              enum:
                - HOSTED_TRADING_ERROR
                - INSUFFICIENT_ESCROW_BALANCE
                - ORDER_SIZE_TOO_SMALL
                - INVALID_API_KEY
                - OUTCOME_NOT_FOUND
                - CATALOG_UNAVAILABLE
                - BUILT_ORDER_EXPIRED
                - INVALID_SIGNATURE
                - NO_LIQUIDITY
                - MISSING_WALLET_ADDRESS
                - ORDER_NOT_FOUND
                - INVALID_ORDER
            retryable:
              type: boolean
              description: >-
                `true` when the same request may succeed if retried (e.g.
                transient catalog outage); `false` when the caller must change
                inputs first.
            exchange:
              type: string
              nullable: true
              description: >-
                Source venue that produced the error (e.g. `polymarket`,
                `opinion`, `limitless`), when the failure originated upstream of
                PMXT. `null` for PMXT-side errors.
            detail:
              type: object
              additionalProperties: {}
              nullable: true
              description: >-
                Free-form structured diagnostics (e.g. required minimum size,
                escrow balance available). Shape varies per `code`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required when calling the hosted API directly (curl, requests, fetch).
        SDK users pass credentials via constructor params instead.

````