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

# Hyperliquid wallet PnL over time

> GET /v1/analytics/user-pnl-series returns a Hyperliquid wallet's realized PnL as a time series, per bucket and cumulative.



## OpenAPI

````yaml GET /v1/analytics/user-pnl-series
openapi: 3.1.0
info:
  title: Ironflow API
  version: 1.0.0
  description: >
    Hyperliquid market data from Ironflow's own nodes: tick-level fills and

    trades, candles, funding rates, liquidations, mark prices, open interest,

    markets and wallet analytics over REST, live Server-Sent Events streams and

    read-only SQL. One schema across native HL perps, HIP-3 builder markets,

    HIP-4 outcome contracts and HL spot.


    The same data is a hosted MCP server for AI agents at

    `https://mcp.ironflow.sh/mcp`, and agents with a USDC wallet on Base can pay

    per call with x402, no key: the data GET endpoints are also served at

    `/x402/v1/...` (discovery: `https://api.ironflow.sh/openapi.json` and

    `https://api.ironflow.sh/.well-known/x402`).


    **Base URL:** `https://api.ironflow.sh`


    **Authentication:** Read endpoints work without a key (keyless access) or

    with a Bearer token in the `Authorization` header. Writes always need a key.

    ```

    Authorization: Bearer if_your_api_key

    ```

    Get a free key at https://ironflow.sh/key.


    **Access levels:**


    | Access | Requests per minute | History | Max range per request |

    |---|---|---|---|

    | No key | 30 per IP (2,000 a day) | 24 hours | 1 hour |

    | Free key | 60 | 30 days | 6 hours |

    | Explorer | 100 | 90 days | 24 hours |

    | Builder | 1,000 | 1 year | 7 days |

    | Enterprise | 10,000 | full | unlimited |


    Without a market filter, high-volume endpoints allow at most 4 hours per
    request.

    `/v1/trades` filtered to one perp or spot market allows 24 hours per request

    without a key and on a free key.

    A header that is present but malformed returns 401; keyless access applies
    only

    when no `Authorization` header is sent.


    **Data availability:** fills and trades start on 25 May 2025; other

    datasets start later (funding 2025-09-27, open interest and mark prices

    2026-04-29). Bulk history is free to download from

    https://huggingface.co/ironflow.


    **Timestamps:** All timestamps are Unix milliseconds (int64).


    **Pagination:** Paginated endpoints return a `cursor` in
    `pagination.next_cursor`.

    Pass it as the `cursor` query parameter to fetch the next page.

    When `pagination.has_more` is `false`, you have reached the last page.


    **Notices:** a successful JSON object may start with `notice`, the

    `X-Ironflow-Notice` header in the body: what was served when it differs from

    what was asked (a keyless sample, a shortened history, a guessed path) and

    how to get the rest.


    **Guessed paths:** a few paths callers guess are answered by the endpoint

    they mean, with a `notice` and the `X-Ironflow-Canonical` header naming it:

    `/v1/liquidations/aggregate`, `/v1/summary/liquidations` and similar by

    `/v1/liquidations/summary`, `/v1/liquidations/buckets` and `heatmap` by

    `/v1/analytics/liquidation-levels`, and `/v1/liquidations/map/BTC-PERP` by

    `/v1/liquidations/map?market=BTC-PERP`. A path with trailing `.`, `,`, `;`
    or

    `)` (`/v1/query.`, copied from a sentence) is answered by the endpoint
    without

    them, with the same method, query and body. OpenAI-style paths
    (`/v1/models`,

    `/v1/chat/completions`) answer 404: this is not an LLM API, and agents use
    the

    MCP server above.
  contact:
    name: Ironflow Support
    url: https://ironflow.sh
servers:
  - url: https://api.ironflow.sh
    description: Production
security:
  - bearerAuth: []
  - {}
tags:
  - name: Market Data
    description: Historical tick-level market data stored in ClickHouse.
  - name: Analytics
    description: >-
      Aggregated analytics. Net flows, funding stats and the liquidation map
      markets work without a key; liquidation levels, the liquidation map and
      the vault leaderboard return a sample without one; order flow needs a key
      (a free key works).
  - name: Cohorts
    description: Predefined and custom address groups for filtering market data.
  - name: Alerts
    description: >-
      Liquidation alerts that Ironflow posts to your webhook, Discord channel,
      Slack channel or Telegram chat.
  - name: Ironbox
    description: >-
      Secure, sandboxed environments in Tokyo, next to Hyperliquid, where a
      trading agent runs with Ironflow's data, analytics, alerts and execution.
      Any API key, free included.
  - name: Query
    description: >-
      Read-only ClickHouse SQL over curated Hyperliquid tables (hl.*), limited
      by tier.
  - name: Billing
    description: >-
      Paid plans, paid in USDC on Hyperliquid or with x402 on Base. No card, no
      account page.
  - name: System
    description: Health checks and metadata endpoints.
  - name: TradingApp
    description: >-
      The trading terminal's own endpoints (terminal.ironflow.sh),
      wallet-session auth. Not part of the public data API; left out of the docs
      copy.
paths:
  /v1/analytics/user-pnl-series:
    get:
      tags:
        - Analytics
      summary: Wallet realized-PnL time series
      description: |
        Bucketed realized PnL time series for one address. Each point is
        the sum of `realized_pnl` over `bucket_ms` ms. Used for the
        wallet X-Ray cumulative PnL chart.
      operationId: getUserPnLSeries
      parameters:
        - $ref: '#/components/parameters/source'
        - $ref: '#/components/parameters/address'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
        - name: bucket_ms
          in: query
          description: Bucket size in ms. Server clamps so the series has ≤500 buckets.
          schema:
            type: integer
            format: int64
            example: 3600000
      responses:
        '200':
          description: Per-bucket realized PnL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  address:
                    type: string
                  from:
                    type: integer
                    format: int64
                  to:
                    type: integer
                    format: int64
                  bucket_ms:
                    type: integer
                    format: int64
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserPnLSeriesPoint'
        '400':
          $ref: '#/components/responses/QueryWindowExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
        '504':
          $ref: '#/components/responses/QueryTimeout'
components:
  parameters:
    source:
      name: source
      in: query
      description: Venue identifier. Defaults to `hyperliquid`.
      schema:
        type: string
        enum:
          - hyperliquid
        default: hyperliquid
      example: hyperliquid
    address:
      name: address
      in: query
      description: Wallet address filter (hex string, e.g. `0xabc123`).
      schema:
        type: string
        example: '0xabc123def456'
    from:
      name: from
      in: query
      description: >-
        Start time as Unix milliseconds. Defaults to 24 hours ago. Clamped to
        tier history window. On /v1/trades and /v1/fills, the time range (to -
        from) is limited per tier (no key 1h, free key 6h, Explorer 24h, Builder
        7d, Enterprise unlimited; without market filter 4h for all tiers).
        Returns QUERY_WINDOW_EXCEEDED (400) if exceeded — paginate with narrower
        from/to windows.
      schema:
        type: integer
        format: int64
        example: 1718313600000
    to:
      name: to
      in: query
      description: End time as Unix milliseconds. Defaults to now.
      schema:
        type: integer
        format: int64
        example: 1718400000000
  schemas:
    UserPnLSeriesPoint:
      type: object
      description: One time-bucket of realized PnL for a wallet.
      required:
        - bucket_start
        - realized_pnl
      properties:
        bucket_start:
          type: integer
          format: int64
          description: Unix ms — bucket boundary
        realized_pnl:
          type: number
          format: double
          description: Sum of realized_pnl in bucket
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: RATE_LIMIT_EXCEEDED
            message:
              type: string
              description: Human-readable error description.
              example: Rate limit exceeded. Retry after 60 seconds.
            upgrade:
              type: object
              description: >-
                On a limit a higher plan lifts, the next plan, its price, what
                it lifts and the call that gets it.
            ironbox:
              type: object
              description: >-
                On a rate limit, the keyless daily cap, the stream limit and the
                SQL time budget, how to run the agent in an Ironbox instead.
              properties:
                why:
                  type: string
                  example: >-
                    No rate limits inside an Ironbox: your agent runs next to
                    Hyperliquid with the data on the box.
                create:
                  type: string
                  example: POST https://api.ironflow.sh/v1/ironbox
                url:
                  type: string
                  format: uri
                  example: https://ironflow.sh/ironbox?utm_source=api
            stream:
              type: string
              description: >-
                On the keyless daily limit of `/v1/liquidations` and
                `/v1/trades`, the live stream that replaces polling.
              example: >-
                GET https://api.ironflow.sh/v1/liquidations/stream (no daily
                limit for keyless streams)
  responses:
    QueryWindowExceeded:
      description: >-
        Time range exceeds the per-request maximum for the caller's tier. Narrow
        the from/to window and paginate.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: QUERY_WINDOW_EXCEEDED
              message: >-
                query time range exceeds maximum 24h0m0s per request for your
                tier — narrow your from/to window and paginate
    InternalError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
    QueryTimeout:
      description: >-
        Query exceeded the 15-second execution limit. Narrow your time range,
        add a market filter, or reduce the limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: QUERY_TIMEOUT
              message: >-
                query took too long — narrow your time range, add a market
                filter, or reduce the limit
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Ironflow API key, format `if_xxxx`. Free keys at
        https://ironflow.sh/key. Optional on read endpoints.

````

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