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

# Get Trader P&L

> Returns a trader's daily P&L time series and pre-derived stats from the precomputed daily_pnl read model: entries (daily cumulative P&L), period stats (all/90d/30d/7d), monthly aggregation, per-year totals, and the drawdown series. Reads the refreshed read model, not a per-request equity replay. A resolved trader with no daily P&L returns an empty structured object (HTTP 200); an unknown address returns 404. Spans both providers wherever the read model has the trader's series.

A trader's daily P\&L time series plus pre-derived stats, read from the precomputed `daily_pnl` read model rather than a per-request equity replay. The response carries daily cumulative P\&L entries, period stats (all-time, 90d, 30d, 7d), monthly aggregation, per-year totals, and the drawdown series.

`{address}` accepts a `0x...` wallet address, a username, or a `trd_`-prefixed trader id.

```bash theme={null}
curl -H "Authorization: Bearer $OXINSIDER_API_KEY" \
  "https://api.0xinsider.com/api/v1/trader/0x863134d00841b2e200492805a01e1e2f5defaa53/pnl"
```

A resolved trader with no daily P\&L returns an empty structured object with `200`; an unknown address returns `404`. The series spans both providers wherever the read model has it.


## OpenAPI

````yaml GET /api/v1/trader/{address}/pnl
openapi: 3.1.0
info:
  title: 0xinsider API
  description: >-
    Find your edge on Polymarket and Kalshi. Every wallet graded, every trade
    scored, every outlier flagged. API exposes trader grades, whale trades,
    smart money signals, and insider detection for AI agents, trading bots, and
    research tools. Normal API requests use a 30-second server timeout that
    returns HTTP 408 Request Timeout with an empty body when exceeded. Public
    REST /api/v1/* endpoints, excluding /api/v1/mcp, use Bearer-token based
    non-credentialed browser CORS: any Origin may call with Authorization,
    Content-Type, If-None-Match, Idempotency-Key, and Mcp-Session-Id request
    headers. Remote MCP at /api/v1/mcp is non-credentialed, but still validates
    Origin against the 0xinsider/localhost allowlist per MCP Streamable HTTP
    DNS-rebinding guidance. Successful browser CORS preflight responses
    advertise Access-Control-Max-Age: 86400. Browser JavaScript may read
    X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After,
    ETag, X-Request-Id, X-Request-Cost, X-Batch-RateLimit-Limit,
    X-Batch-RateLimit-Remaining, X-Batch-RateLimit-Reset, Mcp-Session-Id, and
    X-Mcp-Error-Code response headers. Credentialed first-party routes such as
    /api/keys, /api/billing, and auth endpoints remain restricted to configured
    0xinsider origins.
  version: 1.0.0
  contact:
    name: 0xinsider
    email: support@0xinsider.com
    url: https://0xinsider.com
servers:
  - url: https://api.0xinsider.com
    description: >-
      Production (live data). Authenticate with a live key (oxi_sk_live_...);
      requires an active Insider subscription.
  - url: https://api.0xinsider.com
    description: >-
      Sandbox / test mode (deterministic fixture data, no live rows).
      Authenticate with a test key (oxi_sk_test_...) on a free account. Same
      base URL and paths as production: the key class selects live vs sandbox.
      Test keys are billing-exempt, served from a fixed fixture dataset, and
      never read live data or persist writes; webhooks, usage, and MCP responses
      show the response shape only.
security:
  - bearerAuth: []
tags:
  - name: Traders
    description: Trader intelligence, batch lookups, timelines, and export readiness.
  - name: Positions
    description: Current prediction-market position snapshots from backend-owned mirrors.
  - name: Large Positions
    description: Largest current open positions from graded traders (Polymarket-only).
  - name: Whale Trades
    description: Recent and historical large trade intelligence.
  - name: Leaderboard
    description: Ranked trader discovery and category/strategy leaderboards.
  - name: Markets
    description: Market search, discovery, snapshots, and smart-score flow.
  - name: Insider Radar
    description: Suspicious trading pattern detection.
  - name: Events
    description: Durable public event replay streams.
  - name: Streaming
    description: Resumable real-time Server-Sent Events stream of live feed envelopes.
  - name: Webhooks
    description: Signed builder webhook destinations and delivery controls.
  - name: Usage
    description: Developer API budget and usage introspection.
  - name: System
    description: Health and operational status checks.
  - name: MCP
    description: Remote Model Context Protocol transport.
  - name: Reports
    description: Daily, weekly, monthly, and trader export report snapshots.
paths:
  /api/v1/trader/{address}/pnl:
    get:
      tags:
        - Traders
      summary: Get trader P&L time series
      description: >-
        Returns a trader's daily P&L time series and pre-derived stats from the
        precomputed daily_pnl read model: entries (daily cumulative P&L), period
        stats (all/90d/30d/7d), monthly aggregation, per-year totals, and the
        drawdown series. Reads the refreshed read model, not a per-request
        equity replay. A resolved trader with no daily P&L returns an empty
        structured object (HTTP 200); an unknown address returns 404. Spans both
        providers wherever the read model has the trader's series.
      operationId: getTraderPnl
      parameters:
        - name: address
          in: path
          required: true
          description: Wallet address (0x...), username, or trd_-prefixed trader id.
          schema:
            type: string
      responses:
        '200':
          description: Trader P&L object
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                  - meta
                properties:
                  object:
                    type: string
                    const: trader_pnl
                  data:
                    $ref: '#/components/schemas/TraderPnl'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
              example:
                object: trader_pnl
                data:
                  id: trd_0xabc123
                  entries:
                    - date: '2026-05-12'
                      markets_traded: 3
                      total_volume: 10000
                      cumulative_profit: 50000
                      total_pnl: 50000
                      daily_change: 250
                  stats:
                    all:
                      current: 50000
                      change: 50000
                      change_pct: 0
                      best_day: 5000
                      worst_day: -2000
                      win_days: 30
                      loss_days: 10
                      avg_day: 250
                      rebase_anchor: 0
                    d90:
                      current: 12000
                      change: 12000
                      change_pct: 31.5
                      best_day: 5000
                      worst_day: -2000
                      win_days: 18
                      loss_days: 6
                      avg_day: 500
                      rebase_anchor: 38000
                    d30:
                      current: 4000
                      change: 4000
                      change_pct: 8.7
                      best_day: 2500
                      worst_day: -800
                      win_days: 9
                      loss_days: 3
                      avg_day: 333
                      rebase_anchor: 46000
                    d7:
                      current: 900
                      change: 900
                      change_pct: 1.8
                      best_day: 600
                      worst_day: -150
                      win_days: 4
                      loss_days: 1
                      avg_day: 180
                      rebase_anchor: 49100
                  monthly:
                    - year: 2026
                      month: 5
                      pnl: 12000
                      markets_traded: 18
                  year_totals:
                    - year: 2026
                      pnl: 50000
                  drawdown:
                    - date: '2026-05-12'
                      cumulative_profit: 50000
                      drawdown: -1500
                meta:
                  request_id: req_example
                  cached: false
        '304':
          description: >-
            Not Modified. Returned when If-None-Match matches the current
            payload.
          headers:
            ETag:
              description: Validator for the unchanged payload.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/SubscriptionRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '408':
          $ref: '#/components/responses/RequestTimeout'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/RateLimitUnavailable'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -sS \
              -H 'Authorization: Bearer $OXI_SK' \
              'https://api.0xinsider.com/api/v1/trader/0xabc123/pnl'
components:
  headers:
    ETag:
      description: >-
        Strong validator for conditional GET. Send as If-None-Match to receive
        304 when unchanged.
      schema:
        type: string
        example: '"8f14e45fceea167a5a36dedd4bea2543"'
    X-RateLimit-Limit:
      description: Authenticated V1 per-user request limit for the current sliding window.
      schema:
        type: integer
        example: 100
    X-RateLimit-Remaining:
      description: >-
        Authenticated V1 requests remaining in the current sliding window after
        this response.
      schema:
        type: integer
        example: 84
    X-RateLimit-Reset:
      description: Unix timestamp when the authenticated V1 request window resets.
      schema:
        type: integer
        example: 1710772860
    X-Request-Id:
      description: Server-generated request identifier for support and tracing.
      schema:
        type: string
        example: req_550e8400
  schemas:
    TraderPnl:
      type: object
      required:
        - id
        - entries
        - stats
        - monthly
        - year_totals
        - drawdown
      properties:
        id:
          type: string
          description: Prefixed trader ID (`trd_...`).
        entries:
          type: array
          description: Daily cumulative-P&L series (oldest-first).
          items:
            type: object
            required:
              - date
              - daily_change
            properties:
              date:
                type: string
                format: date
              markets_traded:
                type: integer
                nullable: true
              total_volume:
                type: number
                nullable: true
              cumulative_profit:
                type: number
                nullable: true
              total_pnl:
                type: number
                nullable: true
              daily_change:
                type: number
        stats:
          type: object
          required:
            - all
            - d90
            - d30
            - d7
          properties:
            all:
              type: object
              required:
                - current
                - change
                - change_pct
                - best_day
                - worst_day
                - win_days
                - loss_days
                - avg_day
                - rebase_anchor
              properties:
                current:
                  type: number
                change:
                  type: number
                change_pct:
                  type: number
                best_day:
                  type: number
                best_day_date:
                  type: string
                  format: date
                  nullable: true
                worst_day:
                  type: number
                worst_day_date:
                  type: string
                  format: date
                  nullable: true
                win_days:
                  type: integer
                loss_days:
                  type: integer
                avg_day:
                  type: number
                rebase_anchor:
                  type: number
            d90:
              type: object
              required:
                - current
                - change
                - change_pct
                - best_day
                - worst_day
                - win_days
                - loss_days
                - avg_day
                - rebase_anchor
              properties:
                current:
                  type: number
                change:
                  type: number
                change_pct:
                  type: number
                best_day:
                  type: number
                best_day_date:
                  type: string
                  format: date
                  nullable: true
                worst_day:
                  type: number
                worst_day_date:
                  type: string
                  format: date
                  nullable: true
                win_days:
                  type: integer
                loss_days:
                  type: integer
                avg_day:
                  type: number
                rebase_anchor:
                  type: number
            d30:
              type: object
              required:
                - current
                - change
                - change_pct
                - best_day
                - worst_day
                - win_days
                - loss_days
                - avg_day
                - rebase_anchor
              properties:
                current:
                  type: number
                change:
                  type: number
                change_pct:
                  type: number
                best_day:
                  type: number
                best_day_date:
                  type: string
                  format: date
                  nullable: true
                worst_day:
                  type: number
                worst_day_date:
                  type: string
                  format: date
                  nullable: true
                win_days:
                  type: integer
                loss_days:
                  type: integer
                avg_day:
                  type: number
                rebase_anchor:
                  type: number
            d7:
              type: object
              required:
                - current
                - change
                - change_pct
                - best_day
                - worst_day
                - win_days
                - loss_days
                - avg_day
                - rebase_anchor
              properties:
                current:
                  type: number
                change:
                  type: number
                change_pct:
                  type: number
                best_day:
                  type: number
                best_day_date:
                  type: string
                  format: date
                  nullable: true
                worst_day:
                  type: number
                worst_day_date:
                  type: string
                  format: date
                  nullable: true
                win_days:
                  type: integer
                loss_days:
                  type: integer
                avg_day:
                  type: number
                rebase_anchor:
                  type: number
        monthly:
          type: array
          description: Per-month P&L aggregation.
          items:
            type: object
            required:
              - year
              - month
              - pnl
              - markets_traded
            properties:
              year:
                type: integer
              month:
                type: integer
              pnl:
                type: number
              markets_traded:
                type: integer
        year_totals:
          type: array
          description: Per-year P&L totals (ascending by year).
          items:
            type: object
            required:
              - year
              - pnl
            properties:
              year:
                type: integer
              pnl:
                type: number
        drawdown:
          type: array
          description: Underwater (drawdown) series.
          items:
            type: object
            required:
              - date
              - cumulative_profit
              - drawdown
            properties:
              date:
                type: string
                format: date
              cumulative_profit:
                type: number
              drawdown:
                type: number
    ResponseMeta:
      type: object
      required:
        - request_id
        - cached
      properties:
        request_id:
          type: string
          description: Unique request ID (req_ prefix).
        cached:
          type: boolean
        cache_age_s:
          type: integer
          nullable: true
          description: Cache age in seconds, null if not cached.
    ApiError:
      type: object
      required:
        - object
        - error
        - meta
      properties:
        object:
          type: string
          const: error
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - bad_request
                - invalid_api_key
                - subscription_required
                - forbidden
                - not_found
                - account_locked
                - rate_limited
                - rate_limit_unavailable
                - internal_error
            message:
              type: string
            doc_url:
              type: string
              nullable: true
            param:
              type: string
              nullable: true
        meta:
          $ref: '#/components/schemas/ResponseMeta'
  responses:
    BadRequest:
      description: Invalid request parameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    SubscriptionRequired:
      description: Active Insider subscription required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Account access denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RequestTimeout:
      description: >-
        Request exceeded the server's 30-second transport timeout. The timeout
        response has an empty body because it is generated before handler-level
        JSON error shaping.
    Locked:
      description: Account is locked
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: >-
        Rate limit exceeded (100 req/min; batch endpoints also reserve 100 batch
        item units/min before execution)
      headers:
        Retry-After:
          description: Seconds until rate limit resets.
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
        X-Request-Id:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimitUnavailable:
      description: >-
        Redis-backed authenticated rate limiter unavailable; retry after the
        per-process outage cooldown
      headers:
        Retry-After:
          description: >-
            Seconds until the middleware will probe the Redis-backed rate
            limiter again.
          schema:
            type: integer
        X-Request-Id:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key: Authorization: Bearer oxi_sk_live_... for live data (requires
        an active Insider subscription), or oxi_sk_test_... for sandbox/test
        mode (free account, deterministic fixture data, no live rows). Both key
        classes use the same paths; the prefix selects live vs sandbox.

````