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

# List User Portfolio

> Fetch the detailed portfolio of a specific wallet address on a given blockchain.

This includes the total value of the portfolio in USD and a breakdown of token
balances, including their respective values and quantities.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/generic/portfolio
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/generic/portfolio:
    get:
      tags:
        - Universal
      summary: List User Portfolio
      description: >-
        Fetch the detailed portfolio of a specific wallet address on a given
        blockchain.


        This includes the total value of the portfolio in USD and a breakdown of
        token

        balances, including their respective values and quantities.
      operationId: v1_generic_portfolio
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: user
          in: query
          required: false
          schema:
            type: string
            default: '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
            title: User
          description: The user to get portfolio for.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI, models


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.universal.generic_portfolio(chain=models.V1GenericPortfolioChain.ARBITRUM, user="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.universal.genericPortfolio({
                chain: "arbitrum",
                user: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    Portfolio:
      properties:
        total_value_in_usd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Value In Usd
          description: Total value of the portfolio in USD
          examples:
            - 10000
        token_balances:
          items:
            $ref: >-
              #/components/schemas/compass__api_backend__v1__models__generic__read__response__portfolio__TokenBalance
          type: array
          title: Token Balances
          description: List of token balances in the portfolio
      type: object
      required:
        - total_value_in_usd
        - token_balances
      title: Portfolio
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    compass__api_backend__v1__models__generic__read__response__portfolio__TokenBalance:
      properties:
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: Amount of tokens a particular address holds
          examples:
            - 1.5
        decimals:
          type: integer
          title: Decimals
          description: Number of decimals of the token
          examples:
            - 18
        token_symbol:
          type: string
          title: Token Symbol
          description: Symbol of the token.
          examples:
            - WETH
        token_address:
          type: string
          title: Token Address
          description: Address of the token
          examples:
            - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          description: Price of the token in USD
          examples:
            - 2000
        token_value_in_usd:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Token Value In Usd
          description: Value of the token balance in USD
          examples:
            - 2000
      type: object
      required:
        - amount
        - decimals
        - token_symbol
        - token_address
        - price
        - token_value_in_usd
      title: TokenBalance
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````