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

# Get portfolio

> **Equity** and **PnL** curves plus summary stats for an account over a time range.

### Parameters

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| account | yes | string (hex) | Ethereum-style account address for the sub-account context. |
| from | yes | integer (int64) | Start timestamp in milliseconds (inclusive). Use 0 for all available history. |
| to | yes | integer (int64) | End timestamp in milliseconds (inclusive). Use 0 for the latest available snapshot. |
| interval | yes | string | Aggregation interval for the portfolio curves. |

### Response fields

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| `equity` | yes | object[] | Equity curve sampled from account snapshots. |
| `equity[].timestamp` | yes | integer (int64) | — |
| `equity[].value` | yes | string | — |
| `pnl` | yes | object[] | PnL curve derived from equity, net of bridge and vault cash flows. |
| `pnl[].timestamp` | yes | integer (int64) | — |
| `pnl[].value` | yes | string | — |
| `summary` | yes | object | — |
| `summary.averageLoss` | yes | string | — |
| `summary.averageWin` | yes | string | — |
| `summary.avgDailyPnl` | yes | string | — |
| `summary.longPnl` | yes | string | — |
| `summary.losses` | yes | string | — |
| `summary.maxDrawdownPct` | yes | string | — |
| `summary.pnl` | yes | string | — |
| `summary.pnlVolatilityPct` | yes | string | — |
| `summary.pnlVolatilityUsd` | yes | string | — |
| `summary.profitFactor` | yes | string | — |
| `summary.returnPct` | yes | string | — |
| `summary.sharpeRatio` | yes | string | — |
| `summary.shortPnl` | yes | string | — |
| `summary.totalFunding` | yes | string | — |
| `summary.totalTrades` | yes | integer (int64) | — |
| `summary.volume` | yes | string | — |
| `summary.winRate` | yes | string | — |
| `summary.wins` | yes | string | — |

### Response example

A sample **`200`** response body is attached to this operation as an OpenAPI **example** — see the **Example** panel on this page.



## OpenAPI

````yaml /specs/indexer-openapi.json get /portfolio
openapi: 3.1.0
info:
  title: Rocket Indexer API Documentation
  description: >-
    Welcome to the RocketChain Indexer API documentation!


    The indexer REST API serves historical and aggregated market data from
    ClickHouse. Endpoints cover candles, trades, order history, portfolio
    curves, funding events, bridge events, vault events, current/historical
    instruments, and live instrument details.
  license:
    name: MIT
    url: https://github.com/rocketfoundation/rocket-sdk-rust/blob/main/LICENSE
  version: '1.0'
  x-logo:
    altText: ROCKET
    backgroundColor: '#00000000'
    url: https://www.rocketfoundation.io/assets/rocket-logo.svg
servers:
  - url: https://beta.rocket-cluster-1.com/indexer
    description: Beta
  - url: https://testnet.rocket-cluster-1.com/indexer
    description: Testnet
  - url: https://devnet.rocket-cluster-1.com/indexer
    description: Devnet
security: []
tags:
  - name: Indexer REST-API
    description: >-
      Read-only REST endpoints backed by the RocketChain indexer. All routes are
      served over HTTP GET.
paths:
  /portfolio:
    get:
      tags:
        - Indexer REST-API
      summary: Get portfolio
      description: >-
        **Equity** and **PnL** curves plus summary stats for an account over a
        time range.


        ### Parameters


        | Parameter | Required | Type | Description |

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

        | account | yes | string (hex) | Ethereum-style account address for the
        sub-account context. |

        | from | yes | integer (int64) | Start timestamp in milliseconds
        (inclusive). Use 0 for all available history. |

        | to | yes | integer (int64) | End timestamp in milliseconds
        (inclusive). Use 0 for the latest available snapshot. |

        | interval | yes | string | Aggregation interval for the portfolio
        curves. |


        ### Response fields


        | Parameter | Required | Type | Description |

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

        | `equity` | yes | object[] | Equity curve sampled from account
        snapshots. |

        | `equity[].timestamp` | yes | integer (int64) | — |

        | `equity[].value` | yes | string | — |

        | `pnl` | yes | object[] | PnL curve derived from equity, net of bridge
        and vault cash flows. |

        | `pnl[].timestamp` | yes | integer (int64) | — |

        | `pnl[].value` | yes | string | — |

        | `summary` | yes | object | — |

        | `summary.averageLoss` | yes | string | — |

        | `summary.averageWin` | yes | string | — |

        | `summary.avgDailyPnl` | yes | string | — |

        | `summary.longPnl` | yes | string | — |

        | `summary.losses` | yes | string | — |

        | `summary.maxDrawdownPct` | yes | string | — |

        | `summary.pnl` | yes | string | — |

        | `summary.pnlVolatilityPct` | yes | string | — |

        | `summary.pnlVolatilityUsd` | yes | string | — |

        | `summary.profitFactor` | yes | string | — |

        | `summary.returnPct` | yes | string | — |

        | `summary.sharpeRatio` | yes | string | — |

        | `summary.shortPnl` | yes | string | — |

        | `summary.totalFunding` | yes | string | — |

        | `summary.totalTrades` | yes | integer (int64) | — |

        | `summary.volume` | yes | string | — |

        | `summary.winRate` | yes | string | — |

        | `summary.wins` | yes | string | — |


        ### Response example


        A sample **`200`** response body is attached to this operation as an
        OpenAPI **example** — see the **Example** panel on this page.
      operationId: getPortfolio
      parameters:
        - name: account
          in: path
          required: true
          schema:
            type: string
            format: hex
          example: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
          description: Ethereum-style account address for the sub-account context.
        - name: from
          in: path
          description: >-
            Start timestamp in milliseconds (inclusive). Use 0 for all available
            history.
          required: true
          schema:
            $ref: '#/components/schemas/u64'
          example: 0
        - name: to
          in: path
          description: >-
            End timestamp in milliseconds (inclusive). Use 0 for the latest
            available snapshot.
          required: true
          schema:
            $ref: '#/components/schemas/u64'
          example: 1710086400000
        - name: interval
          in: path
          description: Aggregation interval for the portfolio curves.
          required: true
          schema:
            $ref: '#/components/schemas/CandleTimeframe'
          example: 1h
      responses:
        '200':
          description: Portfolio curves
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPortfolioResponse'
              example:
                equity:
                  - timestamp: 1774360800000
                    value: '1000.00'
                pnl:
                  - timestamp: 1774360800000
                    value: '0'
                summary:
                  averageLoss: '-3.1'
                  averageWin: '3.1'
                  avgDailyPnl: 1.2%
                  longPnl: '4.20'
                  losses: '10'
                  maxDrawdownPct: 12.00%
                  pnl: '13.21'
                  pnlVolatilityPct: 18.00%
                  pnlVolatilityUsd: '180.00'
                  profitFactor: '1.2'
                  returnPct: 2.00%
                  sharpeRatio: '1.2'
                  shortPnl: '3.2'
                  totalFunding: '1.20'
                  totalTrades: 7
                  volume: '21.21'
                  winRate: '1.4'
                  wins: '14'
        '400':
          description: Invalid query parameters
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Internal server error
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    u64:
      type: integer
      format: int64
      minimum: 0
    CandleTimeframe:
      type: string
      description: Candle timeframe/interval for aggregation
      enum:
        - 1m
        - 5m
        - 15m
        - 30m
        - 1h
        - 4h
        - 1d
      example: 1h
    GetPortfolioResponse:
      type: object
      required:
        - equity
        - pnl
        - summary
      properties:
        equity:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioCurvePoint'
          description: Equity curve sampled from account snapshots.
        pnl:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioCurvePoint'
          description: PnL curve derived from equity, net of bridge and vault cash flows.
        summary:
          $ref: '#/components/schemas/PortfolioSummary'
          description: Aggregate portfolio metrics for the requested range.
      examples:
        - equity:
            - timestamp: 1774360800000
              value: '1000.00'
          pnl:
            - timestamp: 1774360800000
              value: '0'
          summary:
            averageLoss: '-3.1'
            averageWin: '3.1'
            avgDailyPnl: 1.2%
            longPnl: '4.20'
            losses: '10'
            maxDrawdownPct: 12.00%
            pnl: '13.21'
            pnlVolatilityPct: 18.00%
            pnlVolatilityUsd: '180.00'
            profitFactor: '1.2'
            returnPct: 2.00%
            sharpeRatio: '1.2'
            shortPnl: '3.2'
            totalFunding: '1.20'
            totalTrades: 7
            volume: '21.21'
            winRate: '1.4'
            wins: '14'
    PortfolioCurvePoint:
      type: object
      required:
        - timestamp
        - value
      properties:
        timestamp:
          $ref: '#/components/schemas/u64'
        value:
          type: string
    PortfolioSummary:
      type: object
      required:
        - pnl
        - totalFunding
        - volume
        - maxDrawdownPct
        - returnPct
        - avgDailyPnl
        - pnlVolatilityPct
        - pnlVolatilityUsd
        - sharpeRatio
        - totalTrades
        - profitFactor
        - winRate
        - wins
        - losses
        - averageWin
        - averageLoss
        - longPnl
        - shortPnl
      properties:
        averageLoss:
          type: string
        averageWin:
          type: string
        avgDailyPnl:
          type: string
        longPnl:
          type: string
        losses:
          type: string
        maxDrawdownPct:
          type: string
        pnl:
          type: string
        pnlVolatilityPct:
          type: string
        pnlVolatilityUsd:
          type: string
        profitFactor:
          type: string
        returnPct:
          type: string
        sharpeRatio:
          type: string
        shortPnl:
          type: string
        totalFunding:
          type: string
        totalTrades:
          type: integer
          format: int64
          minimum: 0
        volume:
          type: string
        winRate:
          type: string
        wins:
          type: string

````