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

# portfolio | Hyperliquid info

> The info endpoint with type: "portfolio" retrieves comprehensive portfolio performance data for a specific user on the Hyperliquid exchange.

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `info` endpoint with `type: "portfolio"` retrieves comprehensive portfolio performance data for a specific user on the Hyperliquid exchange. This endpoint provides detailed historical performance metrics across multiple time periods, enabling thorough analysis of trading performance, account value progression, and volume activity.

## Parameters

### Request body

* `type` (string, required) — The request type. Must be `"portfolio"` to retrieve portfolio data.
* `user` (string, required) — Address in 42-character hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.

## Response

The response is an array of portfolio performance data across different time periods. Each element is a tuple containing a time period identifier and the corresponding performance metrics.

### Response structure

The response contains portfolio data for the following time periods:

**Time period identifiers:**

* `"day"` — Daily portfolio performance (last 24 hours)
* `"week"` — Weekly portfolio performance (last 7 days)
* `"month"` — Monthly portfolio performance (last 30 days)
* `"allTime"` — All-time portfolio performance since account creation
* `"perpDay"` — Daily perpetual trading performance
* `"perpWeek"` — Weekly perpetual trading performance
* `"perpMonth"` — Monthly perpetual trading performance
* `"perpAllTime"` — All-time perpetual trading performance

### Performance metrics structure

Each time period contains the following performance data:

**Account value tracking:**

* `accountValueHistory` — Array of \[timestamp, value] pairs showing account value progression over time
* Timestamps are in milliseconds since Unix epoch
* Values are represented as strings for precision

**Profit and loss tracking:**

* `pnlHistory` — Array of \[timestamp, pnl] pairs showing profit/loss progression over time
* Timestamps are in milliseconds since Unix epoch
* PnL values are represented as strings for precision
* Shows cumulative realized and unrealized PnL

**Volume metrics:**

* `vlm` — Volume metric for the time period as a string
* Represents total trading volume during the period

### Data interpretation

**Account value history:**

* Shows the total account value at specific timestamps
* Includes both cash and position values
* Useful for tracking overall portfolio growth
* Data points are sampled at regular intervals

**PnL history:**

* Shows cumulative profit and loss at specific timestamps
* Includes both realized and unrealized PnL
* Positive values indicate profits, negative values indicate losses
* Tracks performance relative to initial account value

**Volume analysis:**

* Total trading volume for the specified period
* Helps assess trading activity levels
* Can be used to calculate volume-based metrics

## Portfolio analysis insights

### Performance evaluation

**Return analysis:**

* Compare account value at different time points to calculate returns
* Analyze PnL progression to understand profit/loss patterns
* Use different time periods to assess short-term vs long-term performance

**Risk assessment:**

* Examine account value volatility through historical data
* Analyze drawdown periods from PnL history
* Compare performance across different time horizons

**Activity analysis:**

* Volume metrics indicate trading frequency and size
* Compare volume across different periods to identify activity patterns
* Assess relationship between volume and performance

### Time period comparison

**Short-term performance:**

* Daily and weekly data for recent performance analysis
* Useful for tactical trading decisions
* Shows immediate impact of recent trades

**Long-term trends:**

* Monthly and all-time data for strategic analysis
* Helps identify long-term performance trends
* Useful for portfolio allocation decisions

**Perpetual vs spot trading:**

* Separate metrics for perpetual contract performance
* Enables analysis of different trading strategies
* Helps optimize trading approach by instrument type

### Historical data usage

**Trend identification:**

* Use historical data points to identify performance trends
* Analyze correlation between account value and market conditions
* Identify periods of outperformance or underperformance

**Performance attribution:**

* Compare PnL across different time periods
* Identify which periods contributed most to overall performance
* Analyze consistency of returns over time

## Example request

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"type": "portfolio", "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b"}' \
    https://api.hyperliquid.xyz/info
  ```

  ```python Python (hyperliquid-python-sdk) theme={"system"}
  from hyperliquid.info import Info
  from hyperliquid.utils import constants

  # This method is public-only, so it uses the default Hyperliquid mainnet API.
  info = Info(constants.MAINNET_API_URL, skip_ws=True)

  portfolio = info.portfolio("0x31ca8395cf837de08b24da3f660e77761dfb974b")
  print(portfolio)
  ```

  ```typescript TypeScript (@nktkas/hyperliquid) theme={"system"}
  import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";

  // This method is public-only, so the default transport targets the public Hyperliquid API.
  const transport = new HttpTransport();
  const info = new InfoClient({ transport });

  const portfolio = await info.portfolio({
    user: "0x31ca8395cf837de08b24da3f660e77761dfb974b",
  });
  console.log(portfolio);
  ```
</CodeGroup>

## Example response

```json theme={"system"}
[
  [
    "day",
    {
      "accountValueHistory": [
        [
          1741886630493,
          "0.0"
        ],
        [
          1741895270493,
          "0.0"
        ]
      ],
      "pnlHistory": [
        [
          1741886630493,
          "0.0"
        ],
        [
          1741895270493,
          "0.0"
        ]
      ],
      "vlm": "0.0"
    }
  ],
  ["week", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["month", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["allTime", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["perpDay", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["perpWeek", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["perpMonth", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }],
  ["perpAllTime", { "accountValueHistory": [...], "pnlHistory": [...], "vlm": "..." }]
]
```

## Use cases

The `info` endpoint with `type: "portfolio"` is essential for applications that need to:

* **Performance tracking**: Monitor portfolio performance across multiple time horizons
* **Risk management**: Assess portfolio risk through historical volatility and drawdown analysis
* **Portfolio analytics**: Generate comprehensive performance reports and analytics
* **Investment research**: Analyze trading performance to inform investment decisions
* **Backtesting validation**: Compare live performance against backtested strategies
* **Client reporting**: Provide detailed performance reports to clients and stakeholders
* **Performance attribution**: Attribute returns to specific time periods and trading strategies
* **Benchmark comparison**: Compare portfolio performance against market benchmarks
* **Trading strategy evaluation**: Assess the effectiveness of different trading approaches
* **Regulatory compliance**: Maintain detailed performance records for regulatory requirements
* **Academic research**: Study trading behavior and performance patterns
* **Portfolio optimization**: Optimize portfolio allocation based on historical performance
* **Risk-adjusted returns**: Calculate risk-adjusted performance metrics like Sharpe ratio
* **Drawdown analysis**: Identify and analyze maximum drawdown periods
* **Volume analysis**: Analyze trading volume patterns and their impact on performance
* **Market timing analysis**: Evaluate market timing decisions through historical data
* **Performance visualization**: Create charts and graphs showing portfolio progression
* **Alert systems**: Set up alerts based on performance thresholds or trends
* **Tax reporting**: Generate data for tax reporting and capital gains calculations
* **Due diligence**: Conduct thorough analysis of trading track records
* **Strategy development**: Develop new trading strategies based on historical performance data

This endpoint provides comprehensive portfolio intelligence, enabling sophisticated analysis of trading performance and portfolio management on the Hyperliquid platform.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hypercore_info/info_portfolio.json post /info
openapi: 3.0.0
info:
  title: Hyperliquid Node API - Portfolio
  version: 1.0.0
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /info:
    post:
      summary: Query a user's portfolio
      description: >-
        Retrieve comprehensive portfolio performance data for a specific user
        across different time periods, including account value history, PnL
        history, and volume metrics.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - user
              properties:
                type:
                  type: string
                  enum:
                    - portfolio
                  default: portfolio
                  description: >-
                    The request type. Must be 'portfolio' to retrieve portfolio
                    data.
                user:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  default: '0x31ca8395cf837de08b24da3f660e77761dfb974b'
                  description: >-
                    Address in 42-character hexadecimal format; e.g.
                    0x0000000000000000000000000000000000000000.
            example:
              type: portfolio
              user: '0x31ca8395cf837de08b24da3f660e77761dfb974b'
      responses:
        '200':
          description: Successful response with portfolio data
          content:
            application/json:
              schema:
                type: array
                description: >-
                  Array of portfolio performance data across different time
                  periods
                items:
                  type: array
                  description: Tuple containing period name and performance data
                  minItems: 2
                  maxItems: 2
              example:
                - - day
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                      - - 1741895270493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                      - - 1741895270493
                        - '0.0'
                    vlm: '0.0'
                - - week
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - month
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - allTime
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - perpDay
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - perpWeek
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - perpMonth
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'
                - - perpAllTime
                  - accountValueHistory:
                      - - 1741886630493
                        - '0.0'
                    pnlHistory:
                      - - 1741886630493
                        - '0.0'
                    vlm: '0.0'

````