> ## 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.

# Summary

> The wallet's lifetime in one call: settled PnL, volume, fees, markets won and lost, best and worst market, and its open legs for you to value (an open combo is worth its cost).



## OpenAPI

````yaml /openapi.json get /v1/wallets/{wallet}/summary
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}/summary:
    get:
      tags:
        - Wallets
      summary: Summary
      description: >-
        The wallet's lifetime in one call: settled PnL, volume, fees, markets
        won and lost, best and worst market, and its open legs for you to value
        (an open combo is worth its cost).
      operationId: wallet-summary
      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: '0x885783760858e1bd5dd09a3c3f916cfa251ac270'
      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 finalized block the answer reflects.
                  tooLarge:
                    type: boolean
                    description: >-
                      Past maxPositions positions the wallet answers with no
                      rows.
                  maxPositions:
                    type: integer
                    description: 50,000.
                  summary:
                    type: object
                    properties:
                      positions:
                        type: integer
                        description: ''
                      realizedPnl:
                        type: number
                        description: Settled PnL over every position, USD.
                      volume:
                        type: object
                        properties:
                          bought:
                            type: number
                            description: USD.
                          sold:
                            type: number
                            description: USD.
                      fees:
                        type: number
                        description: USD.
                      fills:
                        type: integer
                        description: ''
                      redemptions:
                        type: integer
                        description: Positions redeemed.
                      merges:
                        type: integer
                        description: Positions merged.
                      markets:
                        type: object
                        properties:
                          traded:
                            type: integer
                            description: ''
                          decided:
                            type: integer
                            description: ''
                          won:
                            type: integer
                            description: ''
                          lost:
                            type: integer
                            description: ''
                          wonUsd:
                            type: number
                            description: ''
                          lostUsd:
                            type: number
                            description: ''
                      best:
                        type:
                          - object
                          - 'null'
                        properties:
                          conditionId:
                            type:
                              - string
                              - 'null'
                            description: ''
                          pnl:
                            type: number
                            description: ''
                      worst:
                        type:
                          - object
                          - 'null'
                        properties:
                          conditionId:
                            type:
                              - string
                              - 'null'
                            description: ''
                          pnl:
                            type: number
                            description: ''
                      holdSeconds:
                        type: integer
                        description: >-
                          Total over decided markets; divide by markets.decided
                          for the average.
                      firstActivityAt:
                        type:
                          - integer
                          - 'null'
                        description: ' Unix seconds.'
                      lastActivityAt:
                        type:
                          - integer
                          - 'null'
                        description: ' Unix seconds.'
                      open:
                        type: object
                        properties:
                          positions:
                            type: integer
                            description: ''
                          redeemable:
                            type: integer
                            description: ''
                          cost:
                            type: number
                            description: USD.
                          legs:
                            type: array
                            items:
                              $ref: '#/components/schemas/WalletRow'
                          truncated:
                            type: boolean
                            description: Over 2,000 legs.
                      quality:
                        type: object
                        properties:
                          amm:
                            type: integer
                            description: ''
                          converted:
                            type: integer
                            description: ''
                          partial:
                            type: integer
                            description: ''
                          basisApprox:
                            type: integer
                            description: ''
                        description: Positions carrying each flag.
                    description: Left out when tooLarge.
              example:
                wallet: '0x885783760858e1bd5dd09a3c3f916cfa251ac270'
                block: 94812402
                tooLarge: false
                maxPositions: 50000
                summary:
                  positions: 41
                  realizedPnl: 1830.44
                  volume:
                    bought: 14210.5
                    sold: 9888.12
                  fees: 61.2
                  fills: 133
                  redemptions: 9
                  merges: 0
                  markets:
                    traded: 27
                    decided: 22
                    won: 13
                    lost: 9
                    wonUsd: 3912.08
                    lostUsd: -2081.64
                  best:
                    conditionId: >-
                      0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409
                    pnl: 902.4
                  worst:
                    conditionId: >-
                      0x44e2a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d7
                    pnl: -611
                  holdSeconds: 9417600
                  firstActivityAt: 1746921600
                  lastActivityAt: 1790411022
                  open:
                    positions: 4
                    redeemable: 1
                    cost: 1288.4
                    legs:
                      - wallet: '0x885783760858e1bd5dd09a3c3f916cfa251ac270'
                        outcomeIndex: 0
                        shares: 1200
                        costBasis: 312
                        avgPrice: 0.26
                        avgBuyPrice: 0.26
                        realizedPnl: 0
                        boughtShares: 1200
                        boughtUsd: 312
                        soldShares: 0
                        soldUsd: 0
                        avgSellPrice: 0
                        splitShares: 0
                        mergedShares: 0
                        mergeUsd: 0
                        redeemedShares: 0
                        redeemUsd: 0
                        fees: 1.25
                        fills: 3
                        firstTradeAt: 1783987320
                        lastTradeAt: 1790862117
                        partialHistory: false
                        basisApprox: false
                        converted: false
                        amm: false
                        tokenId: >-
                          85254962656314962064648492774584063365849461315753521676016468731069088672
                        conditionId: >-
                          0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409
                        resolved: false
                        settle: null
                        resolvedAt: null
                        settledPnl: 0
                        invested: 312
                        sharesIn: 1200
                        entryPrice: 0.26
                        pnlPct: 0
                        avgExitPrice: null
                        open: true
                        redeemable: false
                        exitAt: null
                    truncated: false
                  quality:
                    amm: 0
                    converted: 0
                    partial: 0
                    basisApprox: 1
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    WalletRow:
      allOf:
        - $ref: '#/components/schemas/Position'
        - type: object
          properties:
            tokenId:
              type: string
              description: The outcome token, decimal.
            conditionId:
              type:
                - string
                - 'null'
              description: Its market; null when the token is unknown.
            resolved:
              type: boolean
              description: Its market resolved.
            settle:
              type:
                - number
                - 'null'
              description: The payout a share once resolved (0 to 1).
            resolvedAt:
              type:
                - integer
                - 'null'
              description: When it resolved. Unix seconds.
            settledPnl:
              type: number
              description: >-
                Realized PnL plus, once resolved, the payout of shares still
                held minus their cost, in USD.
            invested:
              type: number
              description: Bought plus split shares at $0.50, in USD.
            sharesIn:
              type: number
              description: 'Shares taken in: bought, split, received.'
            entryPrice:
              type: number
              description: Average price of the shares taken in, USD a share.
            pnlPct:
              type:
                - number
                - 'null'
              description: settledPnl / invested, in percent (25 is 25%).
            avgExitPrice:
              type:
                - number
                - 'null'
              description: >-
                Average price received on the way out: sells, merges,
                redemptions.
            open:
              type: boolean
              description: Unresolved and holding at least 0.1 share.
            redeemable:
              type: boolean
              description: Resolved, still holding, and paying out.
            exitAt:
              type:
                - integer
                - 'null'
              description: >-
                When it closed: the resolution if held into it, else its last
                event. Null while open. Unix seconds.
      description: >-
        A position on the wallet routes, settled against its market’s
        resolution. Combos and v2 legs also carry the ComboExtras fields.
    Position:
      type: object
      properties:
        wallet:
          type: string
          description: The wallet, lowercase.
        outcomeIndex:
          type: integer
          description: >-
            0 for the first outcome (Yes, Up), 1 for the second. -1 when the
            token is unknown.
        shares:
          type: number
          description: >-
            Balance now, in shares. Negative when the wallet held shares before
            history Codex saw.
        costBasis:
          type: number
          description: >-
            Fee-inclusive average cost of the shares held (Polymarket’s own
            method), in USD.
        avgPrice:
          type: number
          description: costBasis / shares, USD a share; 0 when none are held.
        avgBuyPrice:
          type: number
          description: Average buy price, fees aside; 0 when it never bought.
        realizedPnl:
          type: number
          description: Realized PnL, net of fees, in USD.
        boughtShares:
          type: number
          description: Shares bought on the order book.
        boughtUsd:
          type: number
          description: Paid for them, before fees, in USD.
        soldShares:
          type: number
          description: Shares sold on the order book.
        soldUsd:
          type: number
          description: Received for them, before fees, in USD.
        avgSellPrice:
          type: number
          description: Average sell price; 0 when it never sold.
        splitShares:
          type: number
          description: Shares minted by splits.
        mergedShares:
          type: number
          description: Shares burned by merges.
        mergeUsd:
          type: number
          description: Collateral merges returned, in USD.
        redeemedShares:
          type: number
          description: Shares redeemed after resolution.
        redeemUsd:
          type: number
          description: Their payout, in USD.
        fees:
          type: number
          description: Fees paid, in USD.
        fills:
          type: integer
          description: Order-book fills.
        firstTradeAt:
          type: integer
          description: >-
            First event of any kind on the position (trades, transfers, splits).
            Unix seconds.
        lastTradeAt:
          type: integer
          description: Latest event of any kind on the position. Unix seconds.
        partialHistory:
          type: boolean
          description: It sold, merged or redeemed more than Codex saw it acquire.
        basisApprox:
          type: boolean
          description: >-
            Transfers, conversions or neg-risk splits moved its basis by an
            approximating rule.
        converted:
          type: boolean
          description: A neg-risk conversion touched it.
        amm:
          type: boolean
          description: It traded with a 2020-22 AMM pool.
      description: One wallet's position in one outcome token.
    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.