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

# Trader context

> Get a wallet profile and position summary together, with timestamps for their data.

Use this endpoint for a wallet overview that combines a profile and position summary in one request. Read the timestamps to check whether each part is current enough for your use.

For a text brief, use [Trader context as Markdown](/api-reference/endpoint/get-trader-context-markdown).

## Parameters

| Parameter | Description |
| - | - |
| `address` | The wallet to look up: a `0x...` address, a Polymarket username, or a `trd_` id. All three return the same document. |

## Key response fields

| Field | Meaning |
| - | - |
| `trader` | The [Trader](/api-reference/endpoint/get-trader) profile, with the `strategy` and `categories` expansions already applied. `quant_metrics` and `trust` are never included here. |
| `trader.data_quality` | The age and availability of the profile's field groups. Always sent. It covers the `trader` object only; `data_as_of` below covers the positions. See [Data age](/api-reference/endpoint/get-trader#data-age). |
| `position_summary` | The object is omitted when 0xinsider has no record of the wallet or Polymarket's net figures for it are unavailable. Check that the field exists before accessing it. |
| `position_summary.sync_coverage` | `markets_synced` divided by `markets_total`, capped at `1.0`. When `markets_total` is `null`, 0, or negative, any synced market makes this `1.0`, so check `markets_total` before you read `1.0` as full coverage. |
| `position_summary.total_realized_pnl` | Profit and loss on settled positions in USD, as Polymarket reports it, with rebates included. It does not depend on `sync_coverage`. |
| `position_summary.resolved_win_rate` | A percentage from 0 to 100: `resolved_wins` divided by `resolved_decided`. A market that settled at exactly 0 is neither a win nor a loss, so it is in neither count. |
| `data_as_of` | How fresh the open positions are: the time of the wallet's latest positions snapshot, or the last completed sync if there is no snapshot. Resolved counts and win rate date to the last full sync instead. |

## Example

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

## What it does not return

* A `404` for a wallet 0xinsider does not track yet. You get a `200`, `trader.sync_status` set to `unknown`, and no `position_summary`.
* `quant_metrics` or `trust`. Both are `expand` values on [Trader](/api-reference/endpoint/get-trader).
* A live feed. This is a snapshot of one moment, which `freshness_note` states in the response itself. Request it again for fresher numbers.
* A freshness time for the settled P\&L figures. `data_as_of` covers open positions only.

## Caching

Save the response's `ETag` and send it in `If-None-Match` on your next request. If the briefing has not changed, the server returns `304 Not Modified` with no body.


## OpenAPI

````yaml GET /api/v1/trader/{address}/context
openapi: 3.1.0
info:
  x-generated-rate-limit-policy-from: web/src/lib/rate-limit-facts.ts via web/scripts/generate-api-policy.ts
  title: 0xinsider API
  description: >-
    Follow provider-exposed large-trade activity from Polymarket. Polymarket
    wallet-attributed trades can add grades, P&L, strategy, and diagnostic-score
    context when sufficient source data exists. Fields can be null or
    unavailable. Normal API requests use a 30-second server timeout that returns
    HTTP 408 Request Timeout with the standard error envelope (error.code
    request_timeout) when exceeded. Every /api/v1 failure answers that envelope,
    including a body that is not JSON or does not fit the request schema (400
    invalid_body), a query or path value that does not parse (400 invalid_query,
    invalid_path), a missing Content-Type: application/json (415
    unsupported_media_type), a body over 1048576 bytes (413 payload_too_large)
    and a method the path does not serve (405 method_not_allowed), each with
    error.param naming the field where one is known and meta.request_id equal to
    X-Request-Id. Unknown query names are ignored by default and reported in
    X-Query-Ignored, while X-Effective-Query lists the normalized names and
    values applied using form-urlencoded decoding, where + is a space; strict
    mode returns 400 bad_request with error.reason unknown_query_parameter
    before the handler runs, including for an unknown name with an incomplete
    percent escape. Every list operation clamps an out-of-range limit into its
    published minimum..maximum instead of refusing it (limit=0 reads one row,
    limit=500 reads the maximum), and X-Effective-Query reports the clamped
    value; only a limit that is not an integer is refused, with 400
    invalid_query. 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, Mcp-Session-Id,
    Mcp-Protocol-Version, Last-Event-Id, and X-Query-Validation request headers.
    X-Query-Validation: strict opts into rejecting unknown query names; the
    default remains compatible. 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 RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, the legacy
    X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After,
    ETag, X-Request-Id, X-Request-Cost, X-Usage-Accounting,
    X-Batch-RateLimit-Limit, X-Batch-RateLimit-Remaining,
    X-Batch-RateLimit-Reset, Mcp-Session-Id, X-Mcp-Error-Code, X-Query-Ignored,
    and X-Effective-Query response headers. Rate-limit headers describe the
    budget a request was counted against: the API key's per-minute window on an
    authenticated call, and the per-IP budget on a public route or on a refused
    credential (401, 402, 403, 423), so a client looping on a bad or lapsed key
    still sees how much room it has. Conditional GET: these operations return a
    weak ETag and answer If-None-Match with 304 Not Modified and an empty body:
    GET /api/v1/health, GET /api/v1/insider-radar, GET
    /api/v1/insider-radar/{id}, GET /api/v1/large-positions, GET
    /api/v1/leaderboard, GET /api/v1/leaderboard/trending, GET
    /api/v1/market/{condition_id}/candles, GET
    /api/v1/market/{condition_id}/flow, GET /api/v1/market/{condition_id}/intel,
    GET /api/v1/market/{condition_id}/snapshot, GET /api/v1/markets/explore, GET
    /api/v1/markets/sharp-money-flows, GET /api/v1/markets/smart-money-flows,
    GET /api/v1/pick-of-the-day, GET /api/v1/pick-of-the-day/archive, GET
    /api/v1/positions, GET /api/v1/sports-edge-observations, GET
    /api/v1/sports-edge-signals, GET /api/v1/trader/{address}, GET
    /api/v1/trader/{address}/context, GET /api/v1/trader/{address}/pnl, GET
    /api/v1/trader/{address}/position-timeline, GET
    /api/v1/traders/{trader}/position-timeline, GET /api/v1/large-trades, GET
    /api/v1/large-trades/history, GET /api/v1/large-trades/{id}, GET
    /api/v1/whale-trades, GET /api/v1/whale-trades/history, GET
    /api/v1/whale-trades/{id}, GET
    /api/v1/whale-trades/{id}/counterparties/executions, GET
    /api/v1/whale-trades/{id}/counterparties/executions/{execution_id}/makers.
    Credentialed first-party routes such as /api/keys, /api/billing, and auth
    endpoints remain restricted to configured 0xinsider origins. Protected V1
    responses, except the zero-cost /api/v1/usage route, after handler execution
    carry X-Usage-Accounting: persisted, failed, or unknown. This reports the
    usage-record write; it does not change the handler result. Do not replay a
    successful mutation to repair an unknown usage record. Before execution,
    unavailable accounting capacity returns HTTP 503 with
    error.reason=request_accounting_unavailable; honor Retry-After. Public API
    responses add the browser-readable Server-Timing header: Processing time in
    milliseconds, for example api;dur=12.345. Includes API authentication, quota
    admission, handler work and response construction. Excludes network transit
    and streamed body or export-file transfer. The engineering budget is
    strictly below 250 ms; this header reports observations, not a latency
    guarantee or a new timeout. Requests through https://0xinsider.com/api/*
    append Server-Timing: web_api;dur=<milliseconds> and X-Web-Request-Id for
    that web origin handler. The web clock includes upstream waiting and
    existing body construction, so do not add it to api;dur. It excludes
    platform routing, cold module initialization, CDN hits and later stream/file
    transfer. On a cache hit these headers describe the earlier origin fill, not
    the current request; static Markdown API routes have no fresh web clock.
  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 Pro subscription. A sandbox key (oxi_sk_test_...) is
      answered with 401 invalid_api_key and error.reason sandbox_api_key.
  - url: https://0xinsider.com/sandbox
    description: >-
      Sandbox. No credential required and no production data: every documented
      operation answers with its documented example or a deterministic sample of
      its response schema. GET /api/v1/stream is the one exclusion and answers
      400 there, because a Server-Sent Events stream is a live connection rather
      than a body. Add ?sandbox_status=<code> to receive one of the error
      responses the operation documents (for example 429 with Retry-After).
      Documented query parameters and JSON request bodies are checked against
      this document, the two context.md routes answer 200 text/markdown, GET
      /api/v1/trader/{address}/export/download answers its 302 with a Location
      the sandbox serves itself rather than an object store, and nothing is
      stored between requests. A sandbox key (oxi_sk_test_..., issued with no
      account by POST https://api.0xinsider.com/api/v1/agents/register) is
      optional: on an operation that requires a credential, a well-formed key is
      answered with X-Oxi-Sandbox-Key: valid and a malformed one with 401
      invalid_api_key.
security:
  - bearerAuth: []
  - oauth2:
      - read
tags:
  - name: Traders
    description: Traders, 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: Large trades
    description: Recent and historical large trades.
  - name: Leaderboard
    description: Ranked trader discovery and category/strategy leaderboards.
  - name: Pick of the Day
    description: >-
      One sourced sharp-money call a day: the side profitable wallets are
      backing, with pre-game odds, the holders, and the track record.
  - name: Games
    description: >-
      Sports and esports games: both sides, schedules, provider status and the
      Polymarket markets linked to each game.
  - name: Markets
    description: Market search, discovery, snapshots, and sharp-money flow.
  - name: Content
    description: Search across 0xinsider editorial content.
  - name: Suspicious trades
    description: Trades whose recorded suspicion score meets the live flag threshold.
  - name: Insider Radar
    description: >-
      Deprecated spelling of Suspicious trades; both operations stay live as
      aliases.
  - 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: Onboarding
    description: >-
      Self-serve agent registration: a sandbox key with no account, and the path
      to live access.
  - 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.
  - name: Account
    description: Identify the account and credential authenticated for a paid API request.
externalDocs:
  description: 0xinsider API docs
  url: https://docs.0xinsider.com
paths:
  /api/v1/trader/{address}/context:
    get:
      tags:
        - Traders
      summary: Get trader context (JSON)
      description: >-
        Returns a single structured context object for one trader: the full
        trader profile (same shape as GET /api/v1/trader/{address}) plus a
        position_summary (sync coverage and realized/unrealized P&L rollups,
        with an as_of open-position freshness clock), the data_as_of freshness
        timestamp (the open-position data's latest /positions snapshot, else
        last completed sync; the snapshot advances only open positions, so
        resolved counts and win rate still date to the last full sync; native
        realized P&L follows its accounting snapshot), and a freshness_note
        describing the point-in-time snapshot semantics. The path accepts an
        Ethereum wallet address (0x...), a known trader username, or a
        trd_-prefixed trader ID emitted by this API. position_summary is omitted
        when the trader is not in the local database or native net economics is
        unavailable; realized fields remain numeric when present; a wallet
        address this API does not track yet returns 200 with sync_status
        'unknown' on the nested trader (no 404), while a value that is not a
        wallet address and matches no username or trader ID this API knows
        returns 404 not_found with error.param address. Append .md to the path
        for the Markdown rendering.
      operationId: getTraderContext
      parameters:
        - name: X-Query-Validation
          in: header
          required: false
          description: >-
            Opt into strict query-name validation. The default is compatible:
            unknown names are ignored and reported in X-Query-Ignored. With
            strict, an unknown name returns 400 bad_request with error.reason
            unknown_query_parameter before the handler runs, including when its
            percent escape is incomplete.
          schema:
            type: string
            enum:
              - strict
        - name: address
          in: path
          required: true
          description: >-
            Ethereum wallet address (0x...), known trader username, or
            trd_-prefixed trader ID emitted by this API.
          schema:
            type: string
        - name: If-None-Match
          in: header
          required: false
          description: >-
            Conditional GET validator from a previous ETag. Matching values
            return 304 Not Modified with an empty body.
          schema:
            type: string
      responses:
        '200':
          description: Trader context
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                  - meta
                properties:
                  object:
                    type: string
                    const: trader_context
                  data:
                    $ref: '#/components/schemas/TraderContext'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
              examples:
                success:
                  summary: Successful response
                  value:
                    object: trader_context
                    data:
                      data_as_of: '2026-09-10T02:04:30.398422Z'
                      freshness_note: >-
                        Point-in-time snapshot. data_as_of is the open-position
                        clock -- the trader's latest position (/positions)
                        snapshot, else the last completed sync. The snapshot
                        advances only open positions; resolved counts and win
                        rate date to the last full sync. Native realized P&L
                        follows its accounting snapshot, whose freshness this
                        clock does not establish. Not a live feed; re-fetch for
                        fresher data.
                      trader:
                        address: '0xabc1230000000000000000000000000000000abc'
                        category_records:
                          - as_of: '2026-09-22T03:17:17.488299Z'
                            brier_event_avg: null
                            canonical_category: Esports
                            edge_lower_95: null
                            edge_mean: null
                            edge_sd: null
                            edge_se: null
                            independent_event_count: 0
                            latest_observation_at: null
                            model_version: category-skill-v2.0.0
                            observation_started_at: '2026-09-01T21:50:07.762477Z'
                            platform: polymarket
                            resolved_condition_count: 0
                            scope: observed_goldsky_primary_taker_fill
                            source_coverage: partial_whale_threshold_fills
                            source_last_success_at: null
                            status: degraded
                            taxonomy_version: category-taxonomy-643
                            unresolved_observation_count: 0
                          - as_of: '2026-09-22T03:17:17.488299Z'
                            brier_event_avg: null
                            canonical_category: Politics
                            edge_lower_95: null
                            edge_mean: null
                            edge_sd: null
                            edge_se: null
                            independent_event_count: 0
                            latest_observation_at: null
                            model_version: category-skill-v2.0.0
                            observation_started_at: '2026-09-01T21:50:07.762477Z'
                            platform: polymarket
                            resolved_condition_count: 0
                            scope: observed_goldsky_primary_taker_fill
                            source_coverage: partial_whale_threshold_fills
                            source_last_success_at: null
                            status: degraded
                            taxonomy_version: category-taxonomy-643
                            unresolved_observation_count: 0
                        category_skill_model:
                          as_of: '2026-09-22T03:17:17.488299Z'
                          model_version: category-skill-v2.0.0
                          observation_started_at: '2026-09-01T21:50:07.762477Z'
                          source_last_success_at: null
                          status: degraded
                          taxonomy_version: category-taxonomy-643
                        data_quality:
                          status: partial
                          as_of: '2026-09-10T02:04:30.398422Z'
                          field_groups:
                            - group: sync
                              owner: traders.last_synced
                              status: fresh
                              as_of: '2026-09-10T02:04:30.398422Z'
                            - group: ranking
                              owner: trader_rankings.computed_at
                              status: fresh
                              as_of: '2026-09-10T06:12:44.120031Z'
                            - group: leaderboard_rank
                              owner: leaderboard_rank_refresh_state.completed_at
                              status: untracked
                              reason: >-
                                only S, A and B wallets are given a leaderboard
                                rank
                            - group: volume
                              owner: trader_usd_volume.observed_at
                              status: unavailable
                              reason: >-
                                no verified both-sides USD volume observation
                                exists for this wallet
                            - group: positions
                              owner: >-
                                trader_position_snapshots.last_refreshed_at|traders.last_synced
                              status: unavailable
                              reason: >-
                                open-position unrealized P&L is unavailable for
                                this wallet
                        grade: D
                        id: trd_0xabc1230000000000000000000000000000000abc
                        last_active: '2026-09-10T02:04:30.398422Z'
                        pnl:
                          total: -1882.16
                          realized: -1882.16
                        score: 40.17
                        stats:
                          daily_win_rate: 0.5299
                          markets_traded: 1889
                          win_rate: 0.6199
                        strategy:
                          description: >-
                            Mixed activity across 1,802 stored markets. No
                            single observed behavior has a clear lead. Category
                            shares describe recorded USD cost basis; style is
                            separate from performance.
                          strategy_type: mixed
                        sync_status: synced
                        synced_at: '2026-09-10T02:04:30.398422Z'
                        username: example_trader
                    meta:
                      request_id: req_example
                      cached: false
                      cost: 1
          headers:
            X-Query-Ignored:
              $ref: '#/components/headers/X-Query-Ignored'
            X-Effective-Query:
              $ref: '#/components/headers/X-Effective-Query'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            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'
            ETag:
              $ref: '#/components/headers/ETag'
            X-Usage-Accounting:
              $ref: '#/components/headers/X-Usage-Accounting'
            Server-Timing:
              $ref: '#/components/headers/Server-Timing'
        '304':
          description: >-
            Not Modified. Returned when If-None-Match matches the current
            payload.
          headers:
            X-Query-Ignored:
              $ref: '#/components/headers/X-Query-Ignored'
            X-Effective-Query:
              $ref: '#/components/headers/X-Effective-Query'
            ETag:
              $ref: '#/components/headers/ETag'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            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'
            X-Usage-Accounting:
              $ref: '#/components/headers/X-Usage-Accounting'
            Server-Timing:
              $ref: '#/components/headers/Server-Timing'
          x-empty-body: true
        '400':
          description: Invalid request parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '402':
          description: >-
            Active Pro subscription required. The key is valid but the account
            has no active Pro subscription; error.reason is
            subscription_inactive and error.message names the reactivation URL
            (https://0xinsider.com/billing). Permanent until a person
            reactivates: no Retry-After, never retry on a schedule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Account access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            The address value names no trader: it is not a wallet address, and
            no username or trader ID this API knows matches it. error.code is
            not_found and error.param is address. A wallet address 0xinsider
            does not track yet is not an error; it returns 200 with sync_status
            "unknown".
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '408':
          description: >-
            The handler did not answer inside the server's 30-second timeout.
            error.code is request_timeout. On GET and HEAD the response carries
            Retry-After and error.retry_at; on a mutation it carries neither,
            because the request may have completed on the server: check its
            state before repeating it, and reuse its Idempotency-Key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '423':
          description: Account is locked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: >-
            Rate limit exceeded. Three independent budgets. (1) 100
            requests/minute per user (sliding window), on every authenticated
            route. (2) On the BATCH routes only: 2500 batch item units/minute
            per user, reserved before any item is executed. A batch with N
            requested items costs N item units, including duplicate and invalid
            items. 2500 = 100 requests x 25 items per batch, which is the most
            item work a key can buy through the request limiter at all: a caller
            may spend their entire 100-request minute on full 25-item batches
            without the item budget being what stops them. The REQUEST budget is
            the effective ceiling, and batching is never the more expensive
            choice. The item budget can still deny at a sliding-window boundary
            (both counters carry the previous window forward with a floor, and
            the item counter runs 25x the request counter), so honor a 429 from
            either. Over-quota batches return 429 with Retry-After plus
            RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset before any
            item work is done. (3) The monthly quota: Pro includes 500,000 and
            Max includes 2,000,000 authenticated requests per UTC calendar
            month. Over the plan's included requests: with pay as you go on, the
            excess bills at USD 0.20 per 1,000 on a monthly invoice, up to four
            times the included allowance (2,000,000 requests for Pro); without
            it, from October 1, 2026, the next request answers 429 rate_limited
            with error.reason monthly_quota_exceeded and a Retry-After to the
            month's reset. Pay-as-you-go accounts receive the same refusal at
            their ceiling. A refused request is not counted. Every authenticated
            response carries X-Monthly-Quota-Limit, X-Monthly-Quota-Remaining,
            and X-Monthly-Quota-Reset (unix seconds, the first of next month).
            (4) The per-address budget: 1200 requests/minute per IP, shared by
            every caller behind one address and counted before authentication,
            on every route. A 429 from it carries error.reason ip_rate_limited
            and describes that bucket in RateLimit-*; a throttled address
            (sustained over-limit traffic) carries error.reason ip_throttled
            with a Retry-After of minutes to days, and a request before it does
            not shorten the cooldown. Every 429 is the standard error envelope
            with meta.request_id equal to X-Request-Id.
          headers:
            Retry-After:
              description: Seconds until rate limit resets.
              schema:
                type: integer
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            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'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          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'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl -sS \
              -H "Authorization: Bearer $OXINSIDER_API_KEY" \
              'https://api.0xinsider.com/api/v1/trader/{address}/context'
components:
  schemas:
    TraderContext:
      type: object
      required:
        - trader
        - data_as_of
        - freshness_note
      properties:
        trader:
          $ref: '#/components/schemas/Trader'
        position_summary:
          type: object
          description: >-
            Aggregate position and P&L coverage for the trader. Omitted entirely
            (key absent, never null) when the trader is not in the local
            database or native net economics is unavailable. Realized fields
            remain numbers when present, including a genuine zero.
          required:
            - markets_total
            - markets_synced
            - markets_resolved
            - markets_open
            - sync_coverage
            - synced_realized_pnl
            - total_realized_pnl
            - unrealized_mtm
            - cost_basis_locked
            - resolved_win_rate
            - resolved_wins
            - resolved_decided
            - as_of
          properties:
            markets_total:
              type: integer
              nullable: true
              description: >-
                Provider markets_traded count when known; null when the provider
                total is unavailable.
            markets_synced:
              type: integer
              description: Markets with locally synced position rows.
            markets_resolved:
              type: integer
              description: Synced markets that have resolved.
            markets_open:
              type: integer
              description: >-
                Synced markets still open with residual value (open positions
                with current value > 0).
            sync_coverage:
              type: number
              description: >-
                markets_synced divided by markets_total when the provider total
                is known (capped at 1.0); 0.0-1.0. When markets_total is unknown
                or not positive (null, 0, or negative), this is 1.0 if any
                markets are synced (else 0.0), so cross-check markets_total
                before treating 1.0 as full coverage.
            synced_realized_pnl:
              type: number
              description: >-
                Native net realized P&L (USD) including credited rebates, minus
                the stored realized component of open positions with positive
                current value. Rebates are credited to the account, not to a
                position, so every credited rebate stays in this figure. NUMERIC
                arithmetic precedes conversion to a JSON number.
            total_realized_pnl:
              type: number
              description: >-
                Native net realized P&L (USD) including credited rebates, read
                directly from the accounting snapshot. Position sync_coverage is
                separate from this accounting basis.
            unrealized_mtm:
              type: number
              description: Mark-to-market unrealized P&L (USD) on open positions.
            cost_basis_locked:
              type: number
              description: Cost basis (USD) currently tied up in open positions.
            resolved_win_rate:
              type: number
              nullable: true
              description: >-
                Win rate as a percentage (0-100): resolved_wins over
                resolved_decided. A resolved market that settled at exactly zero
                realized P&L (a void, a refund, a fully hedged position) is
                neither a win nor a loss and is not in the denominator, the same
                rule the leaderboard applies; null when no resolved market was
                decided.
            resolved_wins:
              type: integer
              nullable: true
              description: >-
                Resolved markets that settled at positive realized P&L: the
                win-rate numerator. Additive; null only on a summary cached
                before the field existed.
            resolved_decided:
              type: integer
              nullable: true
              description: >-
                Resolved markets that settled at a non-zero realized P&L: the
                win-rate denominator. At most markets_resolved; the difference
                is markets settled at exactly zero or with an unknown P&L.
                Additive; null only on a summary cached before the field
                existed.
            as_of:
              type: string
              format: date-time
              nullable: true
              description: >-
                RFC3339 freshness of the served OPEN-position data: the trader's
                latest /positions snapshot, else the last completed sync. The
                snapshot advances ONLY open positions, so read this as the
                open-position freshness clock -- the resolved/closed aggregates
                on this same summary (markets_resolved, resolved_win_rate)
                advance only on a full sync. The value is the /positions
                snapshot instant when one exists, so it is typically at or just
                before the trader-level last sync on a normal sync, and can be
                AFTER it while the active-view loop refreshes open positions
                between full syncs. This clock does not establish native
                accounting freshness. Always present on the wire (serialized as
                JSON null when the trader has neither a snapshot nor a sync);
                never omitted.
        data_as_of:
          type: string
          format: date-time
          nullable: true
          description: >-
            RFC3339 freshness of the OPEN-position-level data: when a
            position_summary is present this mirrors its as_of byte-for-byte
            (latest /positions snapshot, else last completed sync) -- the
            open-position freshness clock, since the snapshot advances only open
            positions; otherwise the trader's last completed sync, even if an
            unserved position snapshot exists. Null when the selected clock is
            unavailable; a missing breakdown does not establish position or
            accounting freshness.
        freshness_note:
          type: string
          description: >-
            Human-readable statement of the point-in-time snapshot semantics
            (data_as_of is the open-position clock -- the latest /positions
            snapshot, else the last completed sync; the snapshot advances only
            open positions, so resolved counts and win rate date to the last
            full sync; native realized P&L follows its accounting snapshot --
            not a live feed; re-fetch for fresher data).
    ResponseMeta:
      type: object
      required:
        - request_id
        - cached
        - cost
      properties:
        request_id:
          type: string
          description: >-
            Unique request ID (req_ prefix). The same value as the X-Request-Id
            response header, the request's usage accounting row and its log
            lines.
        cached:
          type: boolean
        cache_age_s:
          type: integer
          description: >-
            Cache age in seconds. Omitted when the response was not cached, and
            also when it was cached but its age cannot be established (an entry
            stored before its cache carried a computed instant). Never a
            placeholder: an unknown age is reported as no value rather than as
            the cache TTL.
        cost:
          type: integer
          description: >-
            Advisory request weight (relative compute cost). 1 for simple reads;
            higher for heavier endpoints. Not a credit/price.
        ranking_generation:
          type: integer
          description: >-
            Committed PostgreSQL-owned leaderboard generation for the returned
            rows and cursor. Present on GET /api/v1/leaderboard; omitted on
            endpoints that do not read this ranking.
        ranking_as_of:
          type: string
          format: date-time
          description: >-
            Authoritative RFC3339 timestamp from cache_generations.updated_at
            for ranking_generation. It is read in the same repeatable-read
            snapshot as the leaderboard rows and is not request time, cache
            write time, or row insertion order.
        directional_source:
          type: string
          enum:
            - live
            - degraded
          description: >-
            Which path produced the team-directional read on this response. Only
            present on endpoints that compute one (today: GET
            /api/v1/sports-edge-signals). "live" means the read RAN. "degraded"
            means it FAILED, so nothing was measured and the ranking fell back
            to raw conviction. The flag describes the READ, not its consequence:
            a read that ran and found nothing groupable also leaves the
            directional fields null, and that is honestly "live" -- the
            per-signal nulls already say "nothing to enrich here", so this
            snapshot-level flag carries only what they cannot, namely whether
            the read ran at all. A degraded response is cached on the shorter
            degraded TTL so it self-heals. Reported SEPARATELY from
            ranking_source because the two degradations are independent -- a
            sharp-money DB miss weakens the ranking DATA, a directional failure
            removes a ranking WEIGHT -- and a consumer down-weighting a degraded
            response needs to know which input it lost. Omitted on endpoints
            that compute no directional read.
        ranking_source:
          type: string
          enum:
            - live
            - db_only
          description: >-
            Which ranking-data path produced this response. Only present on
            endpoints that can degrade a ranking (today: GET
            /api/v1/sports-edge-signals). "live" is the normal path (the current
            holder pile from the provider batch); "db_only" is the degraded
            fallback (a truthful but weaker trader_markets ranking) served when
            the live sharp-money ranking batch is unavailable (a sharp-money DB
            read failure, not a Polymarket outage) and cached on a shorter TTL,
            so a consumer can down-weight or skip it. Omitted on endpoints that
            never degrade.
        category_skill_source:
          type: string
          enum:
            - live
            - partial
            - degraded
            - unavailable
          description: >-
            Whole filtered snapshot category-evidence status before pagination.
            Operational live always remains partial source coverage.
        category_skill_model_version:
          type: string
        category_skill_taxonomy_version:
          type: string
        category_skill_platform:
          type: string
          const: polymarket
        category_skill_scope:
          type: string
          const: observed_goldsky_primary_taker_fill
        category_skill_source_coverage:
          type: string
          enum:
            - partial_whale_threshold_fills
            - graded_wallet_fills
        category_skill_observation_started_at:
          type: string
          format: date-time
        category_skill_model_operationally_degraded:
          type: boolean
          description: >-
            Whole-model operational readiness captured with the category model
            snapshot. Present on category-enriched responses even when the
            filtered signal list is empty. When true, category_skill_source is
            degraded and sports-edge-signals uses the shorter degraded cache
            TTL.
        category_skill_status_counts:
          type: object
          required:
            - live
            - insufficient
            - stale
            - unknown
            - degraded
          properties:
            live:
              type: integer
              minimum: 0
            insufficient:
              type: integer
              minimum: 0
            stale:
              type: integer
              minimum: 0
            unknown:
              type: integer
              minimum: 0
            degraded:
              type: integer
              minimum: 0
        category_skill_base_payload_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: >-
            SHA-256 of the funded signal membership/order/rank/cursor vector
            immediately before category-skill enrichment. Sports-edge-signals
            only.
        category_skill_enriched_base_payload_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: >-
            Independent SHA-256 recomputation over the same base fields
            immediately after category-skill enrichment. Equality with
            category_skill_base_payload_hash proves shadow enrichment did not
            change funded inputs. Sports-edge-signals only.
    ApiError:
      type: object
      required:
        - object
        - error
        - meta
      properties:
        object:
          type: string
          const: error
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                FROZEN: an existing value never changes meaning. request_timeout
                (408, #16146) was added the way insufficient_scope was: the
                handler did not answer inside the server's 30-second timeout.
                Retry-After and retry_at ride on it only for a safe method (GET,
                HEAD); a timed-out mutation may have completed, so check its
                state and reuse its Idempotency-Key.
              enum:
                - bad_request
                - invalid_api_key
                - subscription_required
                - forbidden
                - insufficient_scope
                - not_found
                - account_locked
                - rate_limited
                - rate_limit_unavailable
                - internal_error
                - request_timeout
            message:
              type: string
            doc_url:
              type: string
            param:
              type: string
            retry_at:
              type: string
              format: date-time
              description: >-
                The recommended next request instant (RFC3339), always in the
                future. Present on every retryable error: `pick_not_released`,
                `rate_limited`, `rate_limit_unavailable`, and
                `read_model_warming`. Omitted otherwise. The absolute twin of
                `Retry-After`; prefer the header for the sleep duration. For
                `pick_not_released`, the earliest of the next scheduled release,
                the next automatic selector attempt, the operating-window start,
                or about 60 seconds. See that response.
            freshness:
              $ref: '#/components/schemas/FreshnessFailure'
            reason:
              type: string
              enum:
                - cursor_expired
                - unknown_endpoint
                - pick_not_released
                - trader_not_tracked
                - read_model_warming
                - database_unavailable
                - request_accounting_unavailable
                - idempotency_in_progress
                - webhook_delivery_in_progress
                - webhook_secret_rotation_not_prepared
                - webhook_secret_rotation_overlap_active
                - sandbox_api_key
                - api_key_in_query
                - subscription_inactive
                - monthly_quota_exceeded
                - invalid_query
                - unknown_query_parameter
                - invalid_path
                - invalid_body
                - unsupported_media_type
                - payload_too_large
                - method_not_allowed
                - ip_rate_limited
                - ip_throttled
                - export_expired
                - freshness_ceiling_unsatisfied
              description: >-
                ADDITIVE (#7209). The specific, actionable cause behind `code`,
                when there is one more specific than the code itself. `code`
                keeps its published values, so existing clients are unaffected;
                new clients branch on `reason`. Omitted when the code already
                says everything we know. pick_not_released: no Pick of the Day
                is published for the current product day; schedule one request
                against retry_at instead of polling. unknown_endpoint: the PATH
                is not a route on this API -- read GET /api/v1, do not retry.
                trader_not_tracked: the wallet is real and the URL is right, but
                the trader is outside the HOT/WARM sync tiers -- stop asking for
                this wallet. cursor_expired: pagination went stale mid-walk --
                re-request the first page and continue. read_model_warming: the
                requested endpoint cannot serve its read model yet; exact causes
                are endpoint-specific and can include a cold or contended
                refresh or a dependency that prevented refresh.
                database_unavailable: the API's database or its connection pool
                is temporarily unreachable (a connection-class failure, not a
                query fault); code stays rate_limit_unavailable, nothing is
                rate-limited, retry after Retry-After / retry_at.
                idempotency_in_progress: retain the exact Idempotency-Key and
                request body, then retry shortly. webhook_delivery_in_progress:
                retry the URL or signing-secret configuration change after the
                destination's active request completes.
                request_accounting_unavailable: accounting capacity is
                unavailable before the handler executes; retry after Retry-After
                / retry_at. sandbox_api_key: the credential is a sandbox key
                (oxi_sk_test_) from POST /api/v1/agents/register, which only the
                sandbox server accepts -- call the sandbox base URL with it, or
                get a live key or OAuth access token; do not retry it here.
                api_key_in_query: the key was sent as a ?token= query parameter,
                which no route reads because URLs land in logs and history; the
                key itself was not checked -- resend it as Authorization:
                Bearer. subscription_inactive: the key is valid but the
                account's Pro subscription has lapsed (402
                subscription_required); permanent until a person reactivates at
                https://0xinsider.com/billing, which the message names -- stop
                retrying on a schedule and surface the link. The key owner is
                emailed once per lapse. monthly_quota_exceeded: the account has
                used the requests Pro includes for the UTC calendar month (429
                rate_limited); retry_at and Retry-After name the first of next
                month, the only retry that can succeed, and the message names
                https://0xinsider.com/developers, where pay as you go for
                requests over the quota is turned on. The X-Monthly-Quota-Limit,
                X-Monthly-Quota-Remaining and X-Monthly-Quota-Reset headers on
                every authenticated response say how close the account is.
                invalid_query, invalid_path, invalid_body (400 bad_request,
                #16146): a query parameter, a path segment or the JSON body did
                not parse or does not fit the route's schema, so no handler ran;
                param names the field when the parser named one (a query key, a
                path segment, a JSON path such as traders[0], or body); fix the
                request, never retry it as sent. unsupported_media_type (415
                bad_request, param content-type): send the body with
                Content-Type: application/json. payload_too_large (413
                bad_request, param body): the body is over 1048576 bytes.
                method_not_allowed (405 bad_request): the path is a route but
                not with this method; the Allow header names the methods it
                serves. ip_rate_limited (429 rate_limited, #16380): the
                per-address budget every caller behind one IP shares, counted
                before authentication, is spent; not the key's own window, and
                the RateLimit-* headers describe that bucket. ip_throttled (429
                rate_limited): the address is in a cooldown after sustained
                over-limit traffic; Retry-After is minutes to days, and a
                request before it does not shorten the cooldown.
        meta:
          $ref: '#/components/schemas/ResponseMeta'
    Trader:
      type: object
      required:
        - id
        - address
        - pnl
        - stats
        - data_quality
      properties:
        id:
          type: string
          description: Prefixed ID (trd_...).
        address:
          type: string
        username:
          type: string
        grade:
          type: string
          enum:
            - S
            - A
            - B
            - C
            - D
            - F
        streak_tier:
          type: string
          enum:
            - hot
            - rising
            - neutral
            - cooling
            - cold
          description: >-
            Hot-streak tier (trailing-7d cross-sectional percentile); a separate
            axis from the all-time grade. Omitted when there is no recent
            activity.
        score:
          type: number
        forecast_score:
          type: number
          description: >-
            Optional forecast score on the documented display scale. Null when
            unavailable.
        forecast_evidence:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            Optional measured forecast context. Missing values remain
            unavailable rather than being inferred.
        rank:
          type: integer
        pnl:
          type: object
          properties:
            total:
              type: number
            realized:
              type: number
              description: >-
                For pnl.realized, expand=trust marks a matching native
                accounting snapshot as computed: native Polymarket realized P&L
                plus credited maker and taker rebates, with fees already
                included. The exact numeric value is truncated toward zero to
                cents before conversion to a JSON number. Without a matching
                native accounting snapshot, pnl.realized is omitted and its
                trust metadata is unavailable. Raw total P&L is never
                substituted for realized P&L.
            unrealized:
              type: number
            last_7d:
              type: number
              description: >-
                DEPRECATED, never sent. The local pnl_7d rollup over-counted P&L
                (#5416 class) and is no longer emitted. Read the provider-native
                weekly window from GET /api/trader/{address}/profile-summary
                instead.
            last_30d:
              type: number
              description: >-
                DEPRECATED, never sent. The local pnl_30d rollup over-counted
                P&L (#5416 class) and is no longer emitted. Read the
                provider-native monthly window from GET
                /api/trader/{address}/profile-summary instead.
            exact:
              $ref: '#/components/schemas/TraderPnlExact'
              description: >-
                Additive lossless counterpart. Omitted when the trusted native
                realized-P&L source is unavailable; existing numeric fields keep
                their display-safe v1 semantics.
        stats:
          type: object
          properties:
            markets_traded:
              type: integer
            win_rate:
              type: number
            daily_win_rate:
              type: number
            total_volume:
              type: number
              description: >-
                Full-history both-sides USD cash volume from Polymarket
                user-volume. Omitted without a verified observation; never
                leaderboard shares. Its observation time is published as the
                volume group in data_quality and as
                trust.total_volume.freshness.as_of, both
                trader_usd_volume.observed_at; synced_at is a different clock
                and is never a substitute for it.
            exact:
              $ref: '#/components/schemas/TraderStatsExact'
              description: >-
                Additive lossless counterpart to `total_volume`. Omitted when
                the verified provider observation is unavailable.
        strategy:
          type: object
          properties:
            strategy_type:
              type: string
              description: >-
                Observed trading style identifier. New rows use two_sided,
                category_focused, high_activity, diversified, mixed, or
                unclassified. Historical identifiers remain readable during
                normal reclassification; style does not predict skill or intent.
            description:
              type: string
            confidence:
              type: number
        category_strengths:
          type: object
          additionalProperties: true
          description: >-
            Per-category rank context when expand=categories is requested.
            Values include available rank, category totals, performance and
            record counts; scaled_total_pnl is a legacy alias of total_pnl. Its
            measurement basis and update timing differ from the plain record
            returned by GET /api/v1/trader/{address}/categories, so the two need
            not agree. Use this for rank context and that route for the plain
            record. The inner key-set is intentionally unconstrained and may
            contain additional compatibility fields.
        quant_metrics:
          type: object
          additionalProperties: false
          required:
            - smart_score
            - copy_score
            - sharpe_30d
            - sharpe_7d
            - profit_factor
            - edge_consistency
            - sharpe_percentile
            - pf_percentile
            - consistency_percentile
          description: >-
            Curated advanced risk/performance metrics (expand=quant_metrics or
            expand[]=quant_metrics). Omitted unless expanded and backed by a
            computed row strictly under six hours old; a missing row, NULL
            computed_at, or age of exactly six hours or more is stale and
            omitted. Provider-input changes may intentionally lag inside the
            bounded six-hour window. When present, all listed fields are present
            (each is a number or null); null means insufficient trade history
            and must not be treated as 0. The fixed field shape is unchanged.
          properties:
            smart_score:
              type: number
              nullable: true
              description: >-
                Trader smart score on a 0..100 display scale; higher is
                stronger. Null when unavailable.
            copy_score:
              type: number
              nullable: true
              description: >-
                Copyability score, 0-100. Same base as smart_score minus
                penalties for traits that make a strategy hard to replicate: -20
                if fewer than 50 markets traded, -15 if positions are highly
                concentrated, -15 if position sizing exceeds about 2x Kelly, -10
                if the worst single-trade loss exceeds 30%, -10 if edge is
                inconsistent; result clamped to 0-100. Higher means easier to
                follow. null when insufficient history.
            sharpe_30d:
              type: number
              nullable: true
              description: >-
                Sharpe ratio over the trailing 30 days (risk-adjusted return;
                higher is better). Magnitude can be large for small samples.
                null when insufficient history.
            sharpe_7d:
              type: number
              nullable: true
              description: >-
                Sharpe ratio over the trailing 7 days (risk-adjusted return;
                higher is better). null when insufficient history.
            profit_factor:
              type: number
              nullable: true
              description: >-
                Gross profit divided by gross loss; greater than 1 is
                profitable. Capped at 1000 when there are effectively no losses.
                null when insufficient history.
            edge_consistency:
              type: number
              nullable: true
              description: >-
                Share of the trader's last 30 days with realized P&L that closed
                positive, 0-1 (higher is more consistent). A day with no
                realized P&L is not one of them, so the window can span months.
                null below 10 such days; null never means 0.
            sharpe_percentile:
              type: number
              nullable: true
              description: >-
                Cross-sectional percentile rank of the trader's Sharpe ratio
                versus all traders, 0-100. null when insufficient history.
            pf_percentile:
              type: number
              nullable: true
              description: >-
                Cross-sectional percentile rank of profit factor versus all
                traders, 0-100. null when insufficient history.
            consistency_percentile:
              type: number
              nullable: true
              description: >-
                Cross-sectional percentile rank of edge consistency versus all
                traders, 0-100. null when insufficient history.
        last_active:
          type: string
          format: date-time
        synced_at:
          type: string
          format: date-time
        sync_status:
          type: string
          description: synced, unknown, or pending.
        data_quality:
          $ref: '#/components/schemas/DataQuality'
          description: >-
            Data age and coverage for this trader body. Always present. Its five
            groups are sync (traders.last_synced, covering pnl.total,
            pnl.realized, stats.markets_traded, stats.win_rate,
            stats.daily_win_rate, last_active, synced_at and sync_status),
            ranking (trader_rankings.computed_at, covering grade, score,
            streak_tier, forecast_score and forecast_evidence), leaderboard_rank
            (leaderboard_rank_refresh_state.completed_at, the completion time of
            the latest fully completed global rank refresh, covering rank),
            volume (trader_usd_volume.observed_at, covering stats.total_volume)
            and positions (trader_position_snapshots.last_refreshed_at with
            traders.last_synced as fallback, covering pnl.unrealized, the
            open-position aggregate). The positions clock is the latest
            successful /positions snapshot when one exists, otherwise the last
            completed trader sync; it does not date closed or native accounting
            values. A rank or position value remains unknown or unavailable when
            its clock or value is absent. For an unknown wallet every group is
            unavailable. If the open-position read itself fails, positions is
            unavailable with a reason that says so, pnl.unrealized is absent,
            and the body is answered fresh (meta.cached false) and is not kept
            for later callers.
        trust:
          $ref: '#/components/schemas/TraderTrust'
          description: >-
            Field-level trust metadata. Present only when expand=trust or
            expand[]=trust is requested.
        category_records:
          type: array
          items:
            $ref: '#/components/schemas/CategorySkillV2'
          description: >-
            Current evidence for observed and known categories
            (expand=categories or expand[]=categories). Omitted unless expanded.
            Includes insufficient, stale, unknown and degraded rows; absence of
            a category is not proof of skill. The global grade is unchanged.
        category_skill_model:
          $ref: '#/components/schemas/CategorySkillModelReadiness'
    FreshnessFailure:
      type: object
      required:
        - max_age_s
        - data_quality_status
      properties:
        max_age_s:
          type: integer
          format: int64
          minimum: 0
          description: The caller's requested whole-response freshness ceiling in seconds.
        actual_age_s:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Age in seconds of the oldest stored data_quality.as_of clock, when
            one is available.
        as_of:
          type: string
          format: date-time
          description: >-
            The oldest stored data-quality clock used to calculate actual_age_s,
            when one is available.
        data_quality_status:
          type: string
          enum:
            - fresh
            - partial
            - unknown
            - untracked
            - unavailable
          description: >-
            The trader body's whole-response data-quality status. Only fresh can
            satisfy max_age_s.
    TraderPnlExact:
      type: object
      required:
        - realized
      description: >-
        Lossless counterparts for trader P&L values. The object is omitted when
        no trusted native realized-P&L snapshot is available.
      properties:
        realized:
          $ref: '#/components/schemas/ExactDecimal'
          description: >-
            Native Polymarket realized P&L plus credited maker and taker
            rebates, with fees included, from the trusted matching
            `trader_trading_pnl.net_realized_pnl` snapshot.
    TraderStatsExact:
      type: object
      required:
        - total_volume
      description: >-
        Lossless counterparts for trader statistics. The object is omitted when
        the verified provider observation is unavailable.
      properties:
        total_volume:
          $ref: '#/components/schemas/ExactDecimal'
          description: >-
            Full-history both-sides Polymarket user-volume atom from the
            verified `trader_usd_volume` observation.
    DataQuality:
      type: object
      description: >-
        Compact data age and coverage for a response body, always present on the
        operations that publish it. Read status and as_of to decide whether to
        use the body at all, and field_groups to see which part is weak.
        Everything here comes from stored observation clocks, so a cached body
        reports the same ages a freshly computed one does: meta.cached and
        meta.cache_age_s stay the only transport-time facts and neither makes
        this block newer. The per-field audit object is still available through
        expand=trust; this is the default summary of the same question.
      required:
        - status
        - field_groups
      properties:
        status:
          type: string
          enum:
            - fresh
            - partial
            - unknown
            - untracked
            - unavailable
          description: >-
            fresh when every group is fresh, unavailable when every group is
            unavailable, and partial in every other case.
        as_of:
          type: string
          format: date-time
          description: >-
            The oldest as_of among the groups that carry one: the age of the
            weakest clock this body rests on. Omitted when no group carries a
            clock.
        field_groups:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityGroup'
          description: >-
            One entry per field group. Entries may be added in later releases,
            so match on group rather than on position or length.
    TraderTrust:
      type: object
      description: >-
        Field-level trust metadata returned only when GET
        /api/v1/trader/{address} includes expand=trust.
      required:
        - total_pnl
        - realized_pnl
        - unrealized_pnl
        - markets_traded
        - win_rate
        - daily_win_rate
        - total_volume
        - grade
        - score
        - forecast_score
        - forecast_evidence
        - rank
        - streak_tier
        - strategy
        - category_strengths
        - quant_metrics
        - last_active
        - synced_at
        - sync_status
        - category_records
        - category_skill_model
      properties:
        total_pnl:
          $ref: '#/components/schemas/TrustMetadata'
        realized_pnl:
          $ref: '#/components/schemas/TrustMetadata'
        unrealized_pnl:
          $ref: '#/components/schemas/TrustMetadata'
        markets_traded:
          $ref: '#/components/schemas/TrustMetadata'
        win_rate:
          $ref: '#/components/schemas/TrustMetadata'
        daily_win_rate:
          $ref: '#/components/schemas/TrustMetadata'
        total_volume:
          $ref: '#/components/schemas/TrustMetadata'
        grade:
          $ref: '#/components/schemas/TrustMetadata'
        score:
          $ref: '#/components/schemas/TrustMetadata'
        forecast_score:
          $ref: '#/components/schemas/TrustMetadata'
        forecast_evidence:
          $ref: '#/components/schemas/TrustMetadata'
        rank:
          $ref: '#/components/schemas/TrustMetadata'
        streak_tier:
          $ref: '#/components/schemas/TrustMetadata'
        strategy:
          $ref: '#/components/schemas/TrustMetadata'
        category_strengths:
          $ref: '#/components/schemas/TrustMetadata'
        quant_metrics:
          $ref: '#/components/schemas/TrustMetadata'
        last_active:
          $ref: '#/components/schemas/TrustMetadata'
        synced_at:
          $ref: '#/components/schemas/TrustMetadata'
        sync_status:
          $ref: '#/components/schemas/TrustMetadata'
        category_records:
          $ref: '#/components/schemas/TrustMetadata'
        category_skill_model:
          $ref: '#/components/schemas/TrustMetadata'
    CategorySkillV2:
      type: object
      description: >-
        Forward-only category evidence from observed Polymarket taker fills.
        Status is category eligibility, not a global letter grade or a guarantee
        of positive edge. Scores are probability differences. Unknown and
        degraded rows withhold scores. Coverage is partial; observation counts
        are not lifetime market counts.
      required:
        - status
        - model_version
        - taxonomy_version
        - platform
        - scope
        - source_coverage
        - canonical_category
        - as_of
        - source_last_success_at
        - observation_started_at
        - latest_observation_at
        - independent_event_count
        - resolved_condition_count
        - unresolved_observation_count
        - edge_mean
        - edge_sd
        - edge_se
        - edge_lower_95
        - brier_event_avg
      properties:
        status:
          type: string
          enum:
            - live
            - insufficient
            - stale
            - unknown
            - degraded
        model_version:
          type: string
        taxonomy_version:
          type: string
          nullable: true
        platform:
          type: string
          enum:
            - polymarket
        scope:
          type: string
          enum:
            - observed_goldsky_primary_taker_fill
        source_coverage:
          type: string
          enum:
            - partial_whale_threshold_fills
            - graded_wallet_fills
        canonical_category:
          type: string
        as_of:
          type: string
          format: date-time
        source_last_success_at:
          type: string
          format: date-time
          nullable: true
        observation_started_at:
          type: string
          format: date-time
        latest_observation_at:
          type: string
          format: date-time
          nullable: true
        independent_event_count:
          type: integer
          minimum: 0
        resolved_condition_count:
          type: integer
          minimum: 0
        unresolved_observation_count:
          type: integer
          minimum: 0
        edge_mean:
          type: number
          nullable: true
        edge_sd:
          type: number
          nullable: true
        edge_se:
          type: number
          nullable: true
        edge_lower_95:
          type: number
          nullable: true
        brier_event_avg:
          type: number
          nullable: true
    CategorySkillModelReadiness:
      type: object
      required:
        - status
        - model_version
        - taxonomy_version
        - observation_started_at
        - as_of
        - source_last_success_at
      properties:
        status:
          type: string
          enum:
            - live
            - insufficient
            - stale
            - unknown
            - degraded
        model_version:
          type: string
        taxonomy_version:
          type: string
        observation_started_at:
          type: string
          format: date-time
        as_of:
          type: string
          format: date-time
        source_last_success_at:
          type: string
          format: date-time
          nullable: true
      description: >-
        Model-wide readiness, read in the same database snapshot as
        category_records. Individual category rows retain their own status.
    ExactDecimal:
      type: object
      required:
        - value
        - unit
        - scale
        - basis
      description: >-
        A lossless decimal atom rendered from the canonical NUMERIC or provider
        value. The value is a decimal string and must be parsed with a decimal
        library; it is never a display string and must not be converted through
        a binary float. `scale` is the source decimal scale. The field is
        omitted when its source is unavailable.
      properties:
        value:
          type: string
          description: >-
            Plain decimal text at full source precision, including a minus sign
            for negative values and trailing zeros when the source scale carries
            them. Parse as an arbitrary-precision decimal.
          pattern: ^-?(0|[1-9][0-9]*)(\.[0-9]+)?$
        unit:
          type: string
          description: Unit of the value, such as `USD`, `USD/share`, or `shares`.
        scale:
          type: integer
          minimum: 0
          description: Number of digits after the decimal point in `value`'s source atom.
        basis:
          type: string
          description: >-
            Backend-owned source or derivation basis. Treat it as provenance,
            not as a display label.
    DataQualityGroup:
      type: object
      description: >-
        One group of response fields that share a writer and therefore share a
        clock.
      required:
        - group
        - owner
        - status
      properties:
        group:
          type: string
          description: >-
            Stable snake_case group name. Names are additive across releases, so
            match on the ones you know and ignore the rest.
        owner:
          type: string
          description: >-
            The table and column that write this group, named so the verdict can
            be audited (for example trader_rankings.computed_at).
        status:
          type: string
          enum:
            - fresh
            - partial
            - unknown
            - untracked
            - unavailable
          description: >-
            fresh: served, and as_of carries this group's real observation or
            computation clock. partial: some of the group's fields are served
            and some are missing. unknown: served, and this read has no clock
            for it, so no age may be inferred. untracked: 0xinsider does not
            track this group for this subject, by design. unavailable: the group
            could not be served. New values may be added; treat one you do not
            recognize as unknown. fresh means the group is tracked and clocked,
            not that it is inside any particular tolerance: compare as_of
            against your own.
        as_of:
          type: string
          format: date-time
          description: >-
            When this group's values were observed or computed. Omitted whenever
            the read cannot measure it, and never filled with the serialization
            time, the cache time, or another group's clock.
        reason:
          type: string
          description: Why the status is not fresh. Omitted when it is.
    TrustMetadata:
      type: object
      description: >-
        Shared source/freshness/reconciliation/completeness metadata for public
        API values that may be cached, stale, partial, computed, or
        provider-unavailable. Unavailable provider values must be represented
        with explicit metadata instead of fabricated zeros or empty arrays.
      required:
        - source
        - freshness
        - reconciliation
        - completeness
      properties:
        source:
          $ref: '#/components/schemas/TrustSource'
        freshness:
          $ref: '#/components/schemas/TrustFreshness'
        reconciliation:
          $ref: '#/components/schemas/TrustReconciliation'
        completeness:
          $ref: '#/components/schemas/TrustCompleteness'
    TrustSource:
      type: object
      description: >-
        Source metadata for a trust-critical value. Providers and DB/read models
        own business truth; clients should not infer missing provider facts from
        titles, slugs, zeros, or empty arrays.
      required:
        - kind
        - owner
      properties:
        kind:
          type: string
          enum:
            - provider
            - database
            - cache
            - computed
            - client_input
            - unavailable
        owner:
          type: string
          description: Provider, table/read-model, cache, or service that owns the value.
        field:
          type: string
          description: Provider field, DB column, or computed field name when applicable.
    TrustFreshness:
      type: object
      description: >-
        Freshness metadata for a trust-critical value. This is separate from
        transport cache fields in ResponseMeta.
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - fresh
            - refreshing
            - stale
            - not_live
            - unknown
            - unavailable
        as_of:
          type: string
          format: date-time
        max_age_s:
          type: integer
          minimum: 0
    TrustReconciliation:
      type: object
      description: How provider-owned facts were reconciled with stored/read-model values.
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - provider_backed
            - db_mirror
            - computed
            - partial
            - not_applicable
            - unavailable
        detail:
          type: string
    TrustCompleteness:
      type: object
      description: >-
        Whether the described value or result set is complete for its stated
        contract.
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - complete
            - partial
            - not_computed
            - not_applicable
            - unavailable
        detail:
          type: string
  headers:
    X-Query-Ignored:
      description: >-
        Comma-separated, percent-encoded query names the operation did not
        publish and therefore ignored in compatible mode. Names are sorted and
        de-duplicated.
      schema:
        type: string
    X-Effective-Query:
      description: >-
        Normalized, percent-encoded query string containing only the recognized
        names and values applied by the operation. Query names and values use
        form-urlencoded decoding, where + is a space. Repeated names are
        retained and sorted by name. A limit outside the operation's published
        minimum..maximum is reported as the clamped value the page used, so the
        header states the page size served rather than the one requested.
      schema:
        type: string
    RateLimit-Limit:
      description: >-
        Request limit of the budget this request was counted against, for its
        current window: the API key's per-minute sliding window on an
        authenticated call; the per-IP budget on a public route and on a refused
        credential (401, 402, 403, 423), which never reaches the per-key
        limiter. Standard RateLimit header spelling.
      schema:
        type: integer
        example: 100
    RateLimit-Remaining:
      description: >-
        Requests remaining in that budget's current window after this response.
        Standard RateLimit header spelling.
      schema:
        type: integer
        example: 84
    RateLimit-Reset:
      description: >-
        Seconds until that budget's current window resets. Standard RateLimit
        header spelling.
      schema:
        type: integer
        example: 42
    X-RateLimit-Limit:
      description: >-
        Request limit of the budget this request was counted against, for its
        current window: the API key's per-minute sliding window on an
        authenticated call; the per-IP budget on a public route and on a refused
        credential (401, 402, 403, 423).
      schema:
        type: integer
        example: 100
    X-RateLimit-Remaining:
      description: Requests remaining in that budget's current window after this response.
      schema:
        type: integer
        example: 84
    X-RateLimit-Reset:
      description: Unix timestamp when that budget's current window resets.
      schema:
        type: integer
        example: 1710772860
    X-Request-Id:
      description: >-
        Server-generated request identifier for support and tracing. On every
        /api/v1 response, including 304, 408, CORS preflights and every error,
        and always equal to meta.request_id in the body. It is the key of the
        request's usage accounting row and of every log line the request
        emitted, so quote either form to support. A client-supplied X-Request-Id
        request header is ignored: the value is never adopted or echoed.
      schema:
        type: string
        example: req_550e8400
    ETag:
      description: >-
        Weak semantic validator for conditional GET. Request-specific response
        metadata is excluded; send as If-None-Match to receive 304 when the
        stable payload is unchanged.
      schema:
        type: string
        example: W/"8f14e45fceea167a5a36dedd4bea2543"
    X-Usage-Accounting:
      description: >-
        Usage-record persistence for a protected V1 handler response. persisted:
        confirmed row; failed: write failed; unknown: completion could not be
        confirmed. Independent of handler success; do not replay successful
        mutations to repair accounting. Absent before accounting admission and
        on public routes. The zero-cost /api/v1/usage route also omits it.
      schema:
        type: string
        enum:
          - persisted
          - failed
          - unknown
    Server-Timing:
      description: >-
        Processing time in milliseconds, for example api;dur=12.345. Includes
        API authentication, quota admission, handler work and response
        construction. Excludes network transit and streamed body or export-file
        transfer. The engineering budget is strictly below 250 ms; this header
        reports observations, not a latency guarantee or a new timeout.
      schema:
        type: string
      example: api;dur=12.345
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Legacy default or named integration API key, or OAuth 2.1 access token,
        in the Authorization header as `Bearer oxi_sk_live_...` or `Bearer
        oxi_at_...`. Default keys retain full access; integration keys are
        limited to their approved read, webhooks, export and usage scopes and
        expire within 90 days. All credentials share the owner's account limits.
        Data calls require an active Pro subscription and return live data. A
        401 carries WWW-Authenticate: Bearer
        resource_metadata="https://api.0xinsider.com/.well-known/oauth-protected-resource"
        (RFC 6750 section 3, RFC 9728).
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.1 authorization code flow with PKCE S256 for apps and MCP
        clients acting for a user. Public clients only (no client secret):
        register with RFC 7591 at https://api.0xinsider.com/oauth/register or
        present an https client ID metadata document URL as client_id.
        Authorization server metadata:
        https://api.0xinsider.com/.well-known/oauth-authorization-server. The
        access token (oxi_at_..., one hour) is sent as `Authorization: Bearer`;
        refresh tokens rotate on every use. A route outside the token's scopes
        answers 403 insufficient_scope. Walkthrough:
        https://0xinsider.com/auth.md.
      flows:
        authorizationCode:
          authorizationUrl: https://0xinsider.com/oauth/authorize
          tokenUrl: https://api.0xinsider.com/oauth/token
          refreshUrl: https://api.0xinsider.com/oauth/token
          scopes:
            read: >-
              Read markets, traders, large trades, positions, reports, search,
              the event stream and every MCP tool
            webhooks: Create, list, verify, rotate and delete webhook endpoints
            export: Start, poll and download trader exports
            usage: Read the caller's API usage counters

````

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