---
title: "Get user portfolio with all pools containing closed positions"
method: GET
path: "/portfolio"
tags: ["Portfolio"]
---

# Get user portfolio with all pools containing closed positions

`GET /portfolio`

Returns a paginated list of pools where the user has closed positions,
sorted by most recent activity (last_closed_at DESC). The response includes:
- Pool metadata (address, token symbols, icons, fees)
- Aggregated PnL data (deposits, withdrawals, fees, total PnL)
- Per-token breakdowns (X and Y)

For detailed position history within each pool, call the /positions/{pool_address}/pnl endpoint.



# Arguments

* `user` - The wallet address of the user
* `page` - Page number for pagination (default: 1)
* `page_size` - Number of pools per page (default: 120, max: 365)
* `days_back` - Only include pools with positions closed within this many days (default: 90)

# Returns

* `200` - The user's portfolio with pool metadata and aggregated PnL
* `400` - Invalid user address or query parameters

## Query parameters

- `user` string, required
- `page` integer
- `page_size` integer
- `days_back` integer

## Response `200`

- GetPortfolioResponse — User portfolio response with aggregated pool data
  - `hasNext` boolean, required
  - `page` integer, required
  - `pageSize` integer, required
  - `pools` PoolPortfolioItem[], required
    - `baseFee` string, required
    - `binStep` string, required
    - `collectFeeMode` integer, required
    - `lastClosedAt` unknown
    - `pnlPctChange` string, required — PnL percent change (USD)
    - `pnlSol` string, required — Total PnL in SOL (historical per-event SOL price)
    - `pnlSolPctChange` string, required — PnL percent change (SOL)
    - `pnlUsd` string, required — Total PnL in USD, including realized and unrealized
    - `poolAddress` string, required
    - `tokenX` string, required
    - `tokenXIcon` string, required
    - `tokenXMint` string, required
    - `tokenY` string, required
    - `tokenYIcon` string, required
    - `tokenYMint` string, required
    - `totalDeposit` string, required — Total deposit in USD
    - `totalDepositSol` string, required — Total deposit in SOL (historical per-event SOL price)
    - `totalDepositTokenX` string, required
    - `totalDepositTokenXSol` string, required
    - `totalDepositTokenXUsd` string, required
    - `totalDepositTokenY` string, required
    - `totalDepositTokenYSol` string, required
    - `totalDepositTokenYUsd` string, required
    - `totalFee` string, required — Total claim fee in USD
    - `totalFeeSol` string, required — Total claim fee in SOL (historical per-event SOL price)
    - `totalFeeTokenX` string, required
    - `totalFeeTokenXSol` string, required
    - `totalFeeTokenXUsd` string, required
    - `totalFeeTokenY` string, required
    - `totalFeeTokenYSol` string, required
    - `totalFeeTokenYUsd` string, required
    - `totalWithdrawal` string, required — Total withdrawal in USD
    - `totalWithdrawalSol` string, required — Total withdrawal in SOL (historical per-event SOL price)
    - `totalWithdrawalTokenX` string, required
    - `totalWithdrawalTokenXSol` string, required
    - `totalWithdrawalTokenXUsd` string, required
    - `totalWithdrawalTokenY` string, required
    - `totalWithdrawalTokenYSol` string, required
    - `totalWithdrawalTokenYUsd` string, required
  - `totalCount` integer, required
  - `totalPositions` integer, required — Total number of closed positions across all pools

---

[API](https://skmtc.net/meteora/apis/dynamic-amm-keeper.md) · [All operations](https://skmtc.net/meteora/apis/dynamic-amm-keeper/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/meteora/dynamic-amm-keeper/revisions/453231c15a14/schema)
