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

# Wallet Trades

> Every trade the wallet made across all markets, newest first, each with its market. Or one market's, with `market`. Or a search over its whole history, with `q`: one answer, newest first, `before` and `market` ignored.



## OpenAPI

````yaml /openapi.json get /v1/wallets/{wallet}/trades
openapi: 3.1.0
info:
  title: Codex API
  version: 1.0.0
  description: >-
    Nomos's Polymarket index, rebuilt from Polygon: holders, positions, PnL,
    trades, leaderboards and live fills.
servers:
  - url: https://codex-api.nomos.trade
security:
  - bearerAuth: []
tags:
  - name: Markets
  - name: Wallets
  - name: Leaderboard
  - name: Events
  - name: Fills
  - name: Crypto Strikes
  - name: Health
paths:
  /v1/wallets/{wallet}/trades:
    get:
      tags:
        - Wallets
      summary: Wallet Trades
      description: >-
        Every trade the wallet made across all markets, newest first, each with
        its market. Or one market's, with `market`. Or a search over its whole
        history, with `q`: one answer, newest first, `before` and `market`
        ignored.
      operationId: wallet-trades
      parameters:
        - name: wallet
          in: path
          required: true
          description: 'The wallet: 0x and 40 hex.'
          schema:
            type: string
            pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
        - name: limit
          in: query
          required: false
          description: Rows, 1 to 500. Out of range is clamped.
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 50
          example: 5
        - name: before
          in: query
          required: false
          description: 'The previous page''s `next`: `ts,block,logIndex`.'
          schema:
            type: string
        - name: market
          in: query
          required: false
          description: One market's trades only (echoed back).
          schema:
            type: string
        - name: q
          in: query
          required: false
          description: >-
            Search: trades whose market question or outcome contains the text.
            Limit defaults to 300.
          schema:
            type: string
      responses:
        '200':
          description: OK
          headers:
            x-ratelimit-limit:
              description: Your rate, requests a minute.
              schema:
                type: integer
            x-ratelimit-remaining:
              description: Requests left in your bucket.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                properties:
                  wallet:
                    type: string
                    description: ''
                  block:
                    type: integer
                    description: >-
                      The trades table's cursor (can run a batch ahead of
                      positions).
                  complete:
                    type: boolean
                    description: ''
                  truncated:
                    type: boolean
                    description: 'Over 20,000 markets: older trades are out of reach.'
                  q:
                    type: string
                    description: Search only.
                  searched:
                    type: boolean
                    description: Search only.
                  total:
                    type: integer
                    description: 'Search only: rows returned.'
                  capped:
                    type: boolean
                    description: 'Search only: more matched.'
                  trades:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/Trade'
                        - type: object
                          properties:
                            market:
                              allOf:
                                - $ref: '#/components/schemas/Market'
                                - type: object
                                  properties:
                                    outcome:
                                      type:
                                        - string
                                        - 'null'
                                      description: The outcome's name.
                              type:
                                - null
                                - 'null'
                        - $ref: '#/components/schemas/ComboExtras'
                  next:
                    type:
                      - string
                      - 'null'
                    description: Send it as `before`; null on a search.
              example:
                wallet: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
                block: 94812405
                complete: true
                truncated: false
                trades:
                  - ts: 1790862117
                    block: 94812345
                    logIndex: 211
                    tx: >-
                      0x3f6a0c0d1d7f4b0a9e2c6b8f51a2e94d7c03b6a1e8f5d2c47a9b0e1f3c5d7e9a
                    wallet: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
                    side: BUY
                    asset: >-
                      85254962656314962064648492774584063365849461315753521676016468731069088672
                    conditionId: >-
                      0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409
                    outcomeIndex: 0
                    price: 0.231
                    size: 2000
                    usd: 462
                    fee: 0.92
                    feeUnit: usd
                    role: taker
                    counterparty: '0xe111180000d2663c0091e4f400237545b87b996b'
                    exchange: ctf-v2
                    market:
                      question: US announces end of Iranian blockade by March 31, 2027?
                      slug: us-announces-end-of-iranian-blockade-by-march-31-2027
                      eventSlug: us-announces-end-of-iranian-blockade
                      image: >-
                        https://polymarket-upload.s3.us-east-2.amazonaws.com/example.png
                      category: Politics
                      outcomes:
                        - 'Yes'
                        - 'No'
                      negRisk: false
                      outcome: 'Yes'
                next: 1790862117,94812345,211
        '400':
          description: A parameter is malformed or out of range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: market must be a condition id
                  value:
                    error: market must be a condition id
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: 'Not ready, or off: retry later'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: trade history is still loading
                  value:
                    error: trade history is still loading
components:
  schemas:
    Trade:
      type: object
      properties:
        ts:
          type: integer
          description: Block time. Unix seconds.
        block:
          type: integer
          description: Block.
        logIndex:
          type: integer
          description: The log's index in the block.
        tx:
          type: string
          description: Transaction hash.
        wallet:
          type: string
          description: The order's owner.
        side:
          type: string
          description: BUY or SELL, from the owner's side.
          enum:
            - BUY
            - SELL
        asset:
          type: string
          description: The token, decimal.
        conditionId:
          type:
            - string
            - 'null'
          description: >-
            Its market; null until the token's market is known (seconds, for a
            brand-new market).
        outcomeIndex:
          type:
            - integer
            - 'null'
          description: Its outcome.
        price:
          type: number
          description: 'usd / size, before the fee: USD a share.'
        size:
          type: number
          description: >-
            Shares as filled. On a V1 buy the fee came out of them: received =
            size − fee.
        usd:
          type: number
          description: Paid (BUY) or received (SELL), before the fee, in USD.
        fee:
          type: number
          description: The fee, in feeUnit.
        feeUnit:
          type: string
          description: usd, or shares on V1 buys.
          enum:
            - usd
            - shares
        role:
          type: string
          description: taker crossed the book; maker rested on it.
          enum:
            - taker
            - maker
        counterparty:
          type: string
          description: >-
            On a maker fill, the taker order's owner; on a taker fill, the
            exchange contract.
        exchange:
          type: string
          description: ctf-v1, negrisk-v1, ctf-v2, negrisk-v2 or combos-v3.
      description: >-
        One fill, from its order owner's side. A match is the taker's fill and
        one fill per maker order.
    Market:
      type: object
      properties:
        question:
          type:
            - string
            - 'null'
          description: The market's question.
        slug:
          type:
            - string
            - 'null'
          description: The market's slug on Polymarket.
        eventSlug:
          type:
            - string
            - 'null'
          description: Its event's slug.
        image:
          type:
            - string
            - 'null'
          description: An https image URL.
        category:
          type:
            - string
            - 'null'
          description: >-
            Politics, Sports, Crypto, Finance, Culture, Mentions, Weather,
            Economics or Tech; null for none of them.
        outcomes:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Outcome names by outcomeIndex.
        negRisk:
          type: boolean
          description: Part of a neg-risk (multi-outcome) event.
      description: Polymarket's metadata for a market.
    ComboExtras:
      type: object
      properties:
        carriedAtCost:
          type: boolean
          description: >-
            An open combo: valued at its cost, with no unrealized PnL, whatever
            marks you send. Only present when true.
        combo:
          type: object
          properties:
            legs:
              type: array
              items:
                type: object
                properties:
                  conditionId:
                    type:
                      - string
                      - 'null'
                    description: The leg's market.
                  question:
                    type:
                      - string
                      - 'null'
                    description: Its question.
                  outcome:
                    type: string
                    description: The side the leg takes.
                  outcomeIndex:
                    type: integer
                    description: 0 or 1.
                  status:
                    type: string
                    description: open, won, lost, void or unknown.
                  resolvedAt:
                    type:
                      - integer
                      - 'null'
                    description: When the leg resolved. Unix seconds.
              description: One per leg.
            legsTotal:
              type: integer
              description: Legs.
            legsWon:
              type: integer
              description: Won.
            legsLost:
              type: integer
              description: Lost.
            legsOpen:
              type: integer
              description: Open.
            legsVoid:
              type: integer
              description: Void (50/50).
            legsUnknown:
              type: integer
              description: Not known yet.
          description: Only on a combo's row.
        v2Leg:
          type: object
          properties:
            module:
              type: string
              description: binary or negRisk.
          description: >-
            Only on a v2 leg's row: a regular market's outcome held through
            Polymarket's protocol-v2 modules.
      description: Fields added to a row when it is a combo or a v2 leg.
    Error:
      type: object
      properties:
        error:
          type: string
          description: What went wrong, for a person to read.
      description: Every error answer.
  responses:
    Unauthorized:
      description: No key, or an unknown or revoked one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unknown or revoked API key
    RateLimited:
      description: >-
        Over your rate, or more than 4 requests (2 streams) at once. Wait
        `Retry-After` seconds.
      headers:
        retry-after:
          description: Seconds to wait.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'rate limit: 600 requests a minute; retry in 1 s'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key: `codex_` and 48 hex characters.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.