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

> The wallet's leaderboard row over any window. The lifetime is its board row; a window counts each market in full when it was decided (resolved or exited) inside the window. The open book is included only when the window ends now.



## OpenAPI

````yaml /openapi.json get /v1/wallets/{wallet}/stats
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}/stats:
    get:
      tags:
        - Wallets
      summary: Wallet Stats
      description: >-
        The wallet's leaderboard row over any window. The lifetime is its board
        row; a window counts each market in full when it was decided (resolved
        or exited) inside the window. The open book is included only when the
        window ends now.
      operationId: wallet-stats
      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: '0x1f0ebc543b2d411f66947041625c0aa1ce61cf79'
        - name: period
          in: query
          required: false
          description: >-
            A rolling window ending now, or the lifetime. Or give `from` and
            `to` instead.
          schema:
            type: string
            enum:
              - all
              - 1d
              - 7d
              - 30d
              - 90d
              - 1y
            default: all
          example: 30d
        - name: from
          in: query
          required: false
          description: A custom window's start, unix seconds.
          schema:
            type: integer
        - name: to
          in: query
          required: false
          description: Its end, unix seconds, exclusive. Now when left out.
          schema:
            type: integer
        - name: category
          in: query
          required: false
          description: >-
            `global`, `Other`, or Politics, Sports, Crypto, Finance, Culture,
            Mentions, Weather, Economics, Tech (any case).
          schema:
            type: string
            default: global
      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:
                  block:
                    type:
                      - integer
                      - 'null'
                    description: The leaderboard rollup's block.
                  asOf:
                    type:
                      - integer
                      - 'null'
                    description: When the rollup ran. Unix seconds.
                  wallet:
                    type: string
                    description: ''
                  period:
                    type: string
                    description: The window asked for.
                  category:
                    type: string
                    description: ''
                  from:
                    type: integer
                    description: ' Unix seconds.'
                  to:
                    type: integer
                    description: ' Unix seconds.'
                  basis:
                    type: string
                    description: 'board: the lifetime board row; settled: a computed window.'
                    enum:
                      - board
                      - settled
                  row:
                    $ref: '#/components/schemas/BoardRow'
                    type:
                      - null
                      - 'null'
              example:
                block: 94812300
                asOf: 1790862180
                wallet: '0x1f0ebc543b2d411f66947041625c0aa1ce61cf79'
                period: 30d
                category: global
                from: 1788270180
                to: 1790862180
                basis: settled
                row:
                  wallet: '0x1f0ebc543b2d411f66947041625c0aa1ce61cf79'
                  category: global
                  totalPnl: 211044.3
                  realizedPnl: 160221.62
                  unrealizedPnl: 50822.68
                  capital: 18320511.9
                  roi: 0.1551
                  volume: 39811240.33
                  buyVolume: 20114002.1
                  sellVolume: 19697238.23
                  shareVolume: 61210455.2
                  fees: 18322.4
                  fills: 48211
                  marketsTraded: 120
                  marketsDecided: 1790
                  marketsWon: 1011
                  marketsLost: 761
                  winRate: 0.5705
                  profitFactor: 1.62
                  profitFactorInfinite: false
                  winsUsd: 7290211.5
                  lossesUsd: -4500001.06
                  avgWin: 7210.89
                  avgLoss: -5913.27
                  best:
                    pnl: 412880.5
                    conditionId: >-
                      0x8db33416a2d1ebde7438c80129e898f89a5deb3852ca64b37c4bf46513204409
                    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
                  worst:
                    pnl: -188004.2
                    conditionId: >-
                      0x2c5e0f3a9b81d47e6c05f2a1b3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6
                    question: Example market
                    slug: example
                    eventSlug: example
                    image: null
                  avgHoldSeconds: 1209600
                  redemptions: 902
                  firstActivityAt: 1667001600
                  lastActivityAt: 1790862117
                  open:
                    count: 31
                    value: 402118.2
                    cost: 351295.52
                  approxMarkets: 4
                  updatedAt: 1790862180
        '400':
          description: A parameter is malformed or out of range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                e0:
                  summary: >-
                    period must be 1d, 7d, 30d, 90d, 1y or all (or give from and
                    to)
                  value:
                    error: >-
                      period must be 1d, 7d, 30d, 90d, 1y or all (or give from
                      and to)
        '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: the leaderboard is not built yet
                  value:
                    error: the leaderboard is not built yet
components:
  schemas:
    BoardRow:
      type: object
      properties:
        wallet:
          type: string
          description: The wallet.
        category:
          type: string
          description: global, Other, or a category name.
        totalPnl:
          type: number
          description: Settled PnL plus the open book at its last fill prices, in USD.
        realizedPnl:
          type: number
          description: Settled PnL, in USD.
        unrealizedPnl:
          type: number
          description: The open book, in USD.
        capital:
          type: number
          description: Bought plus split shares at $0.50, in USD.
        roi:
          type:
            - number
            - 'null'
          description: totalPnl / capital, a fraction.
        volume:
          type: number
          description: Bought plus sold, in USD.
        buyVolume:
          type: number
          description: Bought, in USD.
        sellVolume:
          type: number
          description: Sold, in USD.
        shareVolume:
          type: number
          description: Shares traded.
        fees:
          type: number
          description: Fees, in USD.
        fills:
          type: integer
          description: Fills.
        marketsTraded:
          type: integer
          description: Markets traded.
        marketsDecided:
          type: integer
          description: Resolved, or every leg under 0.1 share.
        marketsWon:
          type: integer
          description: Decided with PnL above 0.
        marketsLost:
          type: integer
          description: Decided with PnL below 0.
        winRate:
          type:
            - number
            - 'null'
          description: won / (won + lost), a fraction.
        profitFactor:
          type:
            - number
            - 'null'
          description: wins / |losses|; null when infinite.
        profitFactorInfinite:
          type: boolean
          description: Wins and no losses.
        winsUsd:
          type: number
          description: Sum of winning markets, in USD.
        lossesUsd:
          type: number
          description: Sum of losing markets (negative), in USD.
        avgWin:
          type:
            - number
            - 'null'
          description: USD.
        avgLoss:
          type:
            - number
            - 'null'
          description: USD, negative.
        best:
          type:
            - object
            - 'null'
          properties:
            pnl:
              type: number
              description: USD.
            conditionId:
              type: string
              description: The market.
            question:
              type:
                - string
                - 'null'
              description: ''
            slug:
              type:
                - string
                - 'null'
              description: ''
            eventSlug:
              type:
                - string
                - 'null'
              description: ''
            image:
              type:
                - string
                - 'null'
              description: ''
        worst:
          type:
            - object
            - 'null'
          properties:
            pnl:
              type: number
              description: USD.
            conditionId:
              type: string
              description: The market.
            question:
              type:
                - string
                - 'null'
              description: ''
            slug:
              type:
                - string
                - 'null'
              description: ''
            eventSlug:
              type:
                - string
                - 'null'
              description: ''
            image:
              type:
                - string
                - 'null'
              description: ''
        avgHoldSeconds:
          type:
            - integer
            - 'null'
          description: Average time from entering a decided market to leaving it.
        redemptions:
          type: integer
          description: Markets it redeemed in.
        firstActivityAt:
          type:
            - integer
            - 'null'
          description: First activity. Unix seconds.
        lastActivityAt:
          type:
            - integer
            - 'null'
          description: Latest activity. Unix seconds.
        open:
          type:
            - object
            - 'null'
          properties:
            count:
              type: integer
              description: Open legs.
            value:
              type: number
              description: At last fill prices, in USD.
            cost:
              type: number
              description: Their cost, in USD.
          description: Its open book; null on a past window.
        approxMarkets:
          type: integer
          description: Markets where a basis was approximated.
        updatedAt:
          type:
            - integer
            - 'null'
          description: When the row last changed. Unix seconds.
      description: A wallet's leaderboard row.
    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.