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

# Perp and spot portfolio

> Perp positions and spot balances from one consistent node state.



## OpenAPI

````yaml /data-api/openapi.json get /v1/accounts/{address}/portfolio
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
  - 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/accounts/{address}/portfolio:
    get:
      tags:
        - Accounts
      summary: Perp and spot portfolio
      description: >-
        Perp positions and spot balances from one consistent node state. This is
        the right view for unified and portfolio-margin accounts, where spot
        collateral backs perps.


        **How it works**

        - Each core-exchange position is one row with `kind` set to `perp`.

        - With `all_dexes=true`, the positions of every perp dex are included,
        HIP-3 too, as hyperdash.com loads them.

        - Each spot balance is one row with `kind` set to `spot`.


        **Fields**

        - `meta` has the core-exchange perp account value, withdrawable,
        maintenance margin and the account abstraction.

        - `meta` also has `equity`, `spot_value` and `staked_value`, as on `GET
        /v1/accounts/{address}`.

        - Equity covers every perp dex, spot at mid and staked HYPE, as
        hyperdash.com shows it.


        **Credits:** 60 per request + 5 per node read.


        **Scope:** `accounts:read`
      operationId: getAccountPortfolio
      parameters:
        - name: address
          in: path
          required: true
          description: 'Wallet address: `0x` followed by 40 hex characters.'
          schema:
            type: string
        - name: all_dexes
          in: query
          required: false
          description: >-
            `true` returns position rows for every perp dex, core first, from
            the same read. Defaults to the core exchange only.
          schema:
            type: string
            default: 'false'
            enum:
              - 'false'
              - 'true'
      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:
                        kind:
                          type: string
                          description: '`perp` or `spot`.'
                        dex:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Perp dex of the position. `native` means the core
                            exchange. `null` for spot.
                        coin:
                          type: string
                          description: Market for a perp, or token for spot.
                        size:
                          type: string
                          description: >-
                            Signed position size for a perp, or total balance
                            for spot. Decimal string.
                        entry:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Entry price for a perp, or entry notional for spot.
                            Decimal string.
                        value:
                          type:
                            - string
                            - 'null'
                          description: Position value for perps, in USD. Decimal string.
                        unrealized_pnl:
                          type:
                            - string
                            - 'null'
                          description: Unrealized PnL, for perps. Decimal string.
                        margin_used:
                          type:
                            - string
                            - 'null'
                          description: Margin used, for perps. Decimal string.
                        liquidation_px:
                          type:
                            - string
                            - 'null'
                          description: Liquidation price, for perps. Decimal string.
                        leverage:
                          type:
                            - integer
                            - 'null'
                          description: Leverage, for perps.
                        hold:
                          type:
                            - string
                            - 'null'
                          description: Held in open orders, for spot. Decimal string.
                        leverage_type:
                          type:
                            - string
                            - 'null'
                          description: For perps, `cross` or `isolated`.
                        max_leverage:
                          type:
                            - integer
                            - 'null'
                          description: For perps, the market max leverage.
                        return_on_equity:
                          type:
                            - string
                            - 'null'
                          description: For perps, return on equity. Decimal string.
                        cum_funding_all_time:
                          type:
                            - string
                            - 'null'
                          description: >-
                            For perps, funding paid on this market, all time.
                            Positive means paid. Decimal string.
                        cum_funding_since_open:
                          type:
                            - string
                            - 'null'
                          description: >-
                            For perps, funding paid since the position opened.
                            Positive means paid. Decimal string.
                        cum_funding_since_change:
                          type:
                            - string
                            - 'null'
                          description: >-
                            For perps, funding paid since the size last changed.
                            Positive means paid. Decimal string.
                        token:
                          type:
                            - integer
                            - 'null'
                          description: For spot, the token index. See `/v1/spot/tokens`.
                    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'
        '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/accounts/0x…/portfolio'
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.