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

# Market activity

> How many wallets opened, added to, reduced, closed or flipped a position in one perp market over the last 1 hour to 7 days, with their fills, notional, size and realized PnL. The answer is aggregate, with no wallet addresses.

**How it works**
- Filter with `action`, `side` and `liquidity`. Split the rows with `group_by`: by action, by side, or by the wallets' PnL or account-size cohort. Add `interval` for a time series; `1h` buckets work up to a 72-hour window.
- Each fill counts as one action. `open` starts from a flat position, `add` grows an existing one, `reduce` is a partial close, `close` goes to flat and `flip` goes through zero to the other side. `entry` is `open` or `flip`.
- `side` is the position's side. A close carries the side it closes, and a flip counts in full on its new side.
- Both sides of every trade count, so unfiltered notional is twice the traded volume.
- `meta.total_wallets`, `meta.total_fills`, `meta.total_notional`, `meta.total_size` and `meta.total_realized_pnl` cover the whole window after the filters.

**Cohorts**
- Cohorts are each wallet's classification today, not at the time of the fill. `meta.cohort_as_of` says when it was last refreshed.
- `cohort_pnl` groups by all-time perp PnL: `extremely_profitable` from 1M USD, `very_profitable` from 100k, `profitable` from 0, `unprofitable` from -100k, `very_unprofitable` from -1M and `rekt` below that.
- `cohort_size` groups by account value: `apex` from 5M USD, `whale` from 1M, `large` from 100k, `medium` from 10k and `small` below that.
- `unknown` is a wallet with no classification on record.

**Freshness**
- Without `end`, the window ends at the latest completed UTC hour.
- `meta.settled` is false while the newest fills of the window may still be landing. Answers are cached for up to 5 minutes.

**Limits**
- The window is at most 7 days and ends on a UTC hour. It includes its start and excludes its end, so chained requests never count a fill twice. Cover a longer period with several requests: fills, notional, size and realized PnL add up across them.
- Wallet counts do not add up across groups, buckets or requests, because one wallet can appear in several.
- Liquidation transfers, auto-deleveraging and settlement fills are not counted.

**Example questions**
- How many wallets opened a BTC long in the last 72 hours, and were they profitable traders? `/v1/markets/BTC/activity?window=72h&action=entry&side=long&group_by=cohort_pnl`, 600 credits.
- Are whales or small accounts shorting ETH today? `/v1/markets/ETH/activity?window=24h&action=entry&side=short&group_by=cohort_size`, 400 credits.
- What is happening in SOL this week: opening, adding, reducing or closing? `/v1/markets/SOL/activity?window=7d&group_by=action`, 1,000 credits.
- When did longs close BTC over the last 3 days, hour by hour? `/v1/markets/BTC/activity?window=72h&action=close&side=long&interval=1h`, 600 credits.
- Are new HYPE positions long or short, counting takers only? `/v1/markets/HYPE/activity?window=24h&action=entry&liquidity=taker&group_by=side`, 400 credits.
- The same hourly BTC question over 2 months: 21 requests of `window=72h`, each with `end` set to the previous window's start, 12,600 credits in total.

**Credits:** 200 per request. Range multiplier: ×2 to 1 day, ×3 to 3 days, ×5 to 7 days.

**Scope:** `analytics:read`



## OpenAPI

````yaml /data-api/openapi.json get /v1/markets/{coin}/activity
openapi: 3.1.0
info:
  title: Hyperdash Data API
  version: v1
  description: >-
    Hyperliquid data from Hyperdash's own nodes and stored datasets; requests
    never call Hyperliquid's public API. Every response reports the credits it
    cost.
servers:
  - url: https://data.hyperdash.com
security: []
tags:
  - name: Accounts
    description: >-
      Paths below are under `/v1/accounts/{address}` unless shown in full.


      - **Holdings now:** the address itself (equity and margin), `/positions`
      (one dex), `/portfolio?all_dexes=true` (every dex and spot),
      `/open-orders`.

      - **Many wallets now:** `/v1/accounts/batch` and
      `/v1/accounts/batch/portfolio` (POST for more than 25).

      - **Activity:** `/fills` (every fill), `/order-fills` (filled orders),
      `/orders` (status updates), `/ledger` (transfers), `/funding`.

      - **Closed trades:** `/completed-trades` (whole history, filters, funding
      in PnL), `/trades` (by close time, no funding in PnL).

      - **PnL as the hyperdash.com profile shows it,** open positions included:
      `/leaderboard`. Closed trades only: `/window-stats`, `/stats`,
      `/stats/by-market`, `/markets-traded`, `/review`.

      - **PnL over time:** `/pnl-calendar` (UTC days), `/pnl-chart` (cumulative,
      net of transfers), `/realized-pnl` (realized only), `/portfolio-daily`
      (Hyperliquid's daily close), `/pnl-history` (perp only, last 90 days).
  - name: Async jobs
  - name: Builders
  - name: Cohorts
  - name: HIP-3 dexes
  - name: Leaderboards
  - name: Lending
  - name: Liquidations
  - name: Markets
  - name: 'Markets: analytics'
  - name: 'Markets: funding'
  - name: 'Markets: liquidation and stop levels'
  - name: 'Markets: open interest and positioning'
  - name: 'Markets: order book'
  - name: 'Markets: prices and candles'
  - name: 'Markets: queue priority'
  - name: 'Markets: trades and flow'
  - name: 'Markets: TWAPs'
  - name: Network
  - name: Outcomes
  - name: Positions
  - name: Referrals
  - name: Snapshots
  - name: Spot
  - name: Staking
  - name: Traders
  - name: Vaults
paths:
  /v1/markets/{coin}/activity:
    get:
      tags:
        - 'Markets: open interest and positioning'
      summary: Market activity
      description: >-
        How many wallets opened, added to, reduced, closed or flipped a position
        in one perp market over the last 1 hour to 7 days, with their fills,
        notional, size and realized PnL. The answer is aggregate, with no wallet
        addresses.


        **How it works**

        - Filter with `action`, `side` and `liquidity`. Split the rows with
        `group_by`: by action, by side, or by the wallets' PnL or account-size
        cohort. Add `interval` for a time series; `1h` buckets work up to a
        72-hour window.

        - Each fill counts as one action. `open` starts from a flat position,
        `add` grows an existing one, `reduce` is a partial close, `close` goes
        to flat and `flip` goes through zero to the other side. `entry` is
        `open` or `flip`.

        - `side` is the position's side. A close carries the side it closes, and
        a flip counts in full on its new side.

        - Both sides of every trade count, so unfiltered notional is twice the
        traded volume.

        - `meta.total_wallets`, `meta.total_fills`, `meta.total_notional`,
        `meta.total_size` and `meta.total_realized_pnl` cover the whole window
        after the filters.


        **Cohorts**

        - Cohorts are each wallet's classification today, not at the time of the
        fill. `meta.cohort_as_of` says when it was last refreshed.

        - `cohort_pnl` groups by all-time perp PnL: `extremely_profitable` from
        1M USD, `very_profitable` from 100k, `profitable` from 0, `unprofitable`
        from -100k, `very_unprofitable` from -1M and `rekt` below that.

        - `cohort_size` groups by account value: `apex` from 5M USD, `whale`
        from 1M, `large` from 100k, `medium` from 10k and `small` below that.

        - `unknown` is a wallet with no classification on record.


        **Freshness**

        - Without `end`, the window ends at the latest completed UTC hour.

        - `meta.settled` is false while the newest fills of the window may still
        be landing. Answers are cached for up to 5 minutes.


        **Limits**

        - The window is at most 7 days and ends on a UTC hour. It includes its
        start and excludes its end, so chained requests never count a fill
        twice. Cover a longer period with several requests: fills, notional,
        size and realized PnL add up across them.

        - Wallet counts do not add up across groups, buckets or requests,
        because one wallet can appear in several.

        - Liquidation transfers, auto-deleveraging and settlement fills are not
        counted.


        **Example questions**

        - How many wallets opened a BTC long in the last 72 hours, and were they
        profitable traders?
        `/v1/markets/BTC/activity?window=72h&action=entry&side=long&group_by=cohort_pnl`,
        600 credits.

        - Are whales or small accounts shorting ETH today?
        `/v1/markets/ETH/activity?window=24h&action=entry&side=short&group_by=cohort_size`,
        400 credits.

        - What is happening in SOL this week: opening, adding, reducing or
        closing? `/v1/markets/SOL/activity?window=7d&group_by=action`, 1,000
        credits.

        - When did longs close BTC over the last 3 days, hour by hour?
        `/v1/markets/BTC/activity?window=72h&action=close&side=long&interval=1h`,
        600 credits.

        - Are new HYPE positions long or short, counting takers only?
        `/v1/markets/HYPE/activity?window=24h&action=entry&liquidity=taker&group_by=side`,
        400 credits.

        - The same hourly BTC question over 2 months: 21 requests of
        `window=72h`, each with `end` set to the previous window's start, 12,600
        credits in total.


        **Credits:** 200 per request. Range multiplier: ×2 to 1 day, ×3 to 3
        days, ×5 to 7 days.


        **Scope:** `analytics:read`
      operationId: getMarketActivity
      parameters:
        - name: coin
          in: path
          required: true
          description: >-
            Perp market as listed, for example `BTC` or `xyz:TSLA`. Not a spot
            pair or an outcome.
          schema:
            type: string
        - name: window
          in: query
          required: false
          description: Look-back that ends at `end`.
          schema:
            type: string
            default: 24h
            enum:
              - 1h
              - 4h
              - 24h
              - 72h
              - 7d
        - name: end
          in: query
          required: false
          description: >-
            End of the window, in epoch milliseconds on a UTC hour. Defaults to
            the latest completed hour.
          schema:
            type: integer
        - name: action
          in: query
          required: false
          description: Position action to count. `entry` is `open` or `flip`.
          schema:
            type: string
            default: all
            enum:
              - all
              - open
              - add
              - reduce
              - close
              - flip
              - entry
        - name: side
          in: query
          required: false
          description: Position side.
          schema:
            type: string
            default: all
            enum:
              - all
              - long
              - short
        - name: liquidity
          in: query
          required: false
          description: Only taker fills or only maker fills.
          schema:
            type: string
            default: all
            enum:
              - all
              - taker
              - maker
        - name: group_by
          in: query
          required: false
          description: >-
            How to split the rows: by action, by side, or by PnL or account-size
            cohort.
          schema:
            type: string
            default: none
            enum:
              - none
              - action
              - side
              - cohort_pnl
              - cohort_size
        - name: interval
          in: query
          required: false
          description: >-
            Time buckets, aligned to UTC. `1h` works up to a 72-hour window.
            Without it, the whole window is one bucket.
          schema:
            type: string
            enum:
              - 1h
              - 4h
              - 1d
      responses:
        '200':
          description: OK
          headers:
            X-Credits-Charged:
              schema:
                type: integer
            X-Credit-Price-Version:
              schema:
                type: integer
            X-Request-Id:
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - has_more
                  - next_cursor
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        t:
                          type: integer
                          description: >-
                            Bucket start, in epoch milliseconds. Without
                            `interval`, the window start.
                        group:
                          type: string
                          description: Group value, or `all` without `group_by`.
                        wallets:
                          type: integer
                          description: Distinct wallets.
                        fills:
                          type: integer
                          description: Fills counted, one per wallet side of a trade.
                        notional:
                          type: string
                          description: >-
                            Notional of those fills, price times size, in quote
                            units.
                        size:
                          type: string
                          description: Size of those fills, in base units.
                        realized_pnl:
                          type: string
                          description: >-
                            Realized PnL of those fills: closed PnL, before
                            fees.
                    description: Result rows.
                  has_more:
                    type: boolean
                    description: '`true` when another page follows.'
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Cursor for the next page, passed as `cursor`. `null` on
                      the last page.
                  meta:
                    type: object
                    description: >-
                      Response metadata. Its keys depend on the endpoint and are
                      described above.
        '400':
          description: 'Invalid parameter (also: a request body that is not valid JSON)'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Invalid, expired or revoked key
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Scope, plan, history or credit limit
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: 'Not found: an unknown market, dex or token'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '409':
          description: Price version changed, or a cursor's snapshot expired
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: >-
            Rate limited (Retry-After; free): request rate, concurrent requests
            (a request counts one slot per 1,000 rows it can return), or this
            server busy with your workspace's requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '502':
          description: Upstream data source failed (free; retry later)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Backend at capacity or temporarily unavailable (Retry-After)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '504':
          description: Upstream data source timed out (free; retry later)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer: []
      x-codeSamples:
        - lang: curl
          source: >-
            curl -H "Authorization: Bearer $HYPERDASH_API_KEY"
            'https://data.hyperdash.com/v1/markets/BTC/activity?window=72h&action=entry&side=long&group_by=cohort_pnl'
components:
  schemas:
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
        - request_id
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
        hint:
          type: string
        request_id:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Your API key, sent as `Bearer hdk_sk_live_v1_…`.

````

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