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

# Get trades

> Paginated trades visible to the caller. `status` walks
`MATCHED → MINED → CONFIRMED` (or `RETRYING`/`FAILED`).
`transaction_hash` is `null` until the trade settles on-chain.
`bucket_index` is currently hardcoded to `0` (per-trade buckets
not yet introduced). `maker_remaining_after_fill` and friends
are absent on pre-PR records — be ready for missing keys.




## OpenAPI

````yaml /api-reference/openapi.yaml get /trades
openapi: 3.0.3
info:
  title: XO Orderbook API
  description: |
    Public REST surface of the XO CLOB API.

    XO mainnet chain id is `3223`. The EIP-712 order domain is
    `XO Market CLOB` with `verifyingContract` set to the
    [CTF Exchange](/) address. See
    [Smart accounts](../guides/smart-accounts) for the smart-account
    identity model and ERC-1271 order signing.

    Wire conventions:
      * Prices are trimmed decimal strings (e.g. `"0.5"`, `"0.555"`).
      * Sizes are decimal-string integers in human shares.
      * Timestamps in trade and book responses are stringified Unix
        seconds / milliseconds (the SDK uses `TimestampSeconds<String>`
        / `TimestampMilliSeconds<String>`).
      * Token IDs are decimal U256 strings; condition IDs are
        `0x`-prefixed 32-byte hex.
  version: 1.0.0
  contact:
    name: XO Market
    url: https://beta.xo.market
servers:
  - url: https://orderbooks.xo.market
    description: Mainnet (XO chain id 3223)
security: []
tags:
  - name: Authentication
    description: >-
      Create and manage API keys. The L1 ClobAuth EIP-712 flow mints HMAC
      credentials that authenticate every other private request.
  - name: Market Data
    description: >-
      Public reads for books, prices, midpoints, spreads, last trades, and price
      history. Also includes server time and per-token configuration.
  - name: Markets
    description: >-
      Discovery for tradable markets, including pagination and SDK-compatible
      simplified shapes.
  - name: Trade
    description: Place, cancel, and inspect orders and trades for the authenticated maker.
  - name: Account
    description: Maker balance, allowance, positions, and claimable settled positions.
paths:
  /trades:
    get:
      tags:
        - Trade
      summary: Get trades
      description: |
        Paginated trades visible to the caller. `status` walks
        `MATCHED → MINED → CONFIRMED` (or `RETRYING`/`FAILED`).
        `transaction_hash` is `null` until the trade settles on-chain.
        `bucket_index` is currently hardcoded to `0` (per-trade buckets
        not yet introduced). `maker_remaining_after_fill` and friends
        are absent on pre-PR records — be ready for missing keys.
      parameters:
        - in: query
          name: market
          schema:
            type: string
        - in: query
          name: address
          schema:
            type: string
        - in: query
          name: taker_only
          schema:
            type: boolean
        - in: query
          name: limit
          schema:
            type: integer
        - in: query
          name: next_cursor
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradesPage'
              examples:
                populated:
                  summary: caller's two most recent fills (illustrative)
                  value:
                    limit: 100
                    count: 2
                    next_cursor: LTE=
                    data:
                      - id: >-
                          0xc0ffee0000000000000000000000000000000000000000000000000000000a11
                        market: >-
                          0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb
                        outcome: 'Yes'
                        side: BUY
                        price: '0.553'
                        size: '15000000'
                        status: CONFIRMED
                        match_time: '1779355812'
                        last_update: '1779355820'
                        bucket_index: 0
                        transaction_hash: >-
                          0xdeadbeef000000000000000000000000000000000000000000000000000000c0
                        taker_order_id: >-
                          0xfeed00000000000000000000000000000000000000000000000000000000000a
                        asset_id: >-
                          26516164265702901957933644848127860370782874751279270726689263951695181556943
                        fee_rate_bps: '0'
                        owner: 346629a1-8226-5a85-823f-3a25ae818e10
                        maker_address: '0xBEEF000000000000000000000000000000000B22'
                        trader_side: TAKER
                        maker_orders:
                          - order_id: '77'
                            maker_address: '0xBEEF000000000000000000000000000000000B22'
                            owner: 9c4f0d6b-5a3e-5b8c-9e1d-2f3a4b5c6d7e
                            matched_amount: '15000000'
                            price: '0.553'
                            fee_rate_bps: '0'
                            asset_id: >-
                              26516164265702901957933644848127860370782874751279270726689263951695181556943
                            outcome: 'Yes'
                        maker_original_size: '50000000'
                        maker_remaining_after_fill: '35000000'
                        taker_original_size: '15000000'
                        taker_remaining_after_fill: '0'
                      - id: >-
                          0xc0ffee0000000000000000000000000000000000000000000000000000000a12
                        market: >-
                          0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb
                        outcome: 'Yes'
                        side: SELL
                        price: '0.550'
                        size: '20000000'
                        status: MATCHED
                        match_time: '1779355790'
                        last_update: '1779355790'
                        bucket_index: 0
                        transaction_hash: null
                        taker_order_id: >-
                          0xfeed00000000000000000000000000000000000000000000000000000000000b
                        asset_id: >-
                          26516164265702901957933644848127860370782874751279270726689263951695181556943
                        fee_rate_bps: '0'
                        owner: 346629a1-8226-5a85-823f-3a25ae818e10
                        maker_address: '0xBEEF000000000000000000000000000000000B22'
                        trader_side: MAKER
                        maker_orders: []
                no_trades:
                  summary: caller has no fills yet
                  value:
                    limit: 100
                    count: 0
                    next_cursor: LTE=
                    data: []
        '401':
          $ref: '#/components/responses/Error401'
      security:
        - L2HMAC: []
      x-codeSamples:
        - lang: Rust
          label: xo-orderbook-client-rs
          source: |
            // Requires an authenticated client.
            use xo_orderbook_client::orderbook::types::request::TradesRequest;

            let page = client.trades(&TradesRequest::default(), None).await?;
            for t in &page.data {
                println!("{} {:?} {} @ {}", t.id, t.trader_side, t.size, t.price);
            }
components:
  schemas:
    TradesPage:
      type: object
      required:
        - limit
        - count
        - next_cursor
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TradeResponse'
        next_cursor:
          type: string
          description: |
            Base64-encoded offset cursor. `"LTE="` = end of stream
            (canonical CLOB sentinel). NOT nullable.
        count:
          type: integer
        limit:
          type: integer
    TradeResponse:
      type: object
      required:
        - id
        - market
        - outcome
        - side
        - price
        - size
        - status
        - match_time
        - last_update
        - bucket_index
        - taker_order_id
        - asset_id
        - fee_rate_bps
        - owner
        - maker_address
        - trader_side
      properties:
        id:
          type: string
          description: 0x-prefixed 32-byte trade id
        market:
          type: string
          description: conditionId
        outcome:
          type: string
        side:
          type: string
          enum:
            - BUY
            - SELL
        price:
          type: string
        size:
          type: string
        status:
          type: string
          enum:
            - MATCHED
            - MINED
            - CONFIRMED
            - RETRYING
            - FAILED
        match_time:
          type: string
          description: Unix seconds, stringified (TimestampSeconds<String>)
        last_update:
          type: string
          description: Unix seconds, stringified
        bucket_index:
          type: integer
          description: Hardcoded `0` until per-trade buckets are introduced
        transaction_hash:
          type: string
          nullable: true
        taker_order_id:
          type: string
        asset_id:
          type: string
        fee_rate_bps:
          type: string
          description: |
            Compatibility field. Always `"0"` — signed orders no longer carry
            a fee rate. See the Fees guide for how settlement fees are charged.
        owner:
          type: string
          description: UUIDv5 of the authenticated caller's user id
        maker_address:
          type: string
        trader_side:
          type: string
          enum:
            - MAKER
            - TAKER
        maker_orders:
          type: array
          items:
            $ref: '#/components/schemas/MakerOrderEntry'
        maker_original_size:
          type: string
        maker_remaining_after_fill:
          type: string
        taker_original_size:
          type: string
        taker_remaining_after_fill:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    MakerOrderEntry:
      type: object
      required:
        - order_id
        - maker_address
        - owner
        - matched_amount
        - price
        - fee_rate_bps
        - asset_id
        - outcome
      properties:
        order_id:
          type: string
        owner:
          type: string
          format: uuid
        maker_address:
          type: string
        matched_amount:
          type: string
        price:
          type: string
        fee_rate_bps:
          type: string
          description: |
            Compatibility field. Always `"0"` — signed orders no longer carry
            a fee rate. See the Fees guide for how settlement fees are charged.
        asset_id:
          type: string
        outcome:
          type: string
          enum:
            - 'Yes'
            - 'No'
  responses:
    Error401:
      description: |
        Authentication failure. L1 ClobAuth (wallet) or L2 HMAC (API key)
        headers were missing, malformed, expired, or did not match the
        requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            l1_required:
              summary: L1 ClobAuth headers missing
              value:
                error: L1 ClobAuth headers required
            l2_required:
              summary: HMAC credentials missing
              value:
                error: HMAC L2 credentials required
            address_mismatch:
              summary: L1-recovered address does not match request
              value:
                error: L1 auth address does not match request address
  securitySchemes:
    L2HMAC:
      type: apiKey
      in: header
      name: XO_API_KEY
      description: >-
        L2 HMAC request signature. See
        [Authentication](/api-reference/authentication).

````