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

# Get Portfolio

> Retrieve all prediction market tokens held by a wallet address, including current balances and market values.



## OpenAPI

````yaml openapi.json get /v1/tokens/portfolio/{address}
openapi: 3.0.0
info:
  title: Swaps API
  description: The Swaps API documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://swap-api.flux.fun
    description: Production
  - url: http://localhost:3000
    description: Development
security: []
tags: []
paths:
  /v1/tokens/portfolio/{address}:
    get:
      tags:
        - Prediction Markets & Portfolio
      summary: Get Portfolio
      description: >-
        Retrieve all prediction market tokens held by a wallet address,
        including current balances and market values.
      operationId: TokensController_getPortfolio
      parameters:
        - name: address
          required: true
          in: path
          description: The wallet address to get portfolio for
          schema:
            type: string
        - name: chainId
          required: false
          in: query
          description: 'Chain ID (default: 8453 for Base)'
          schema:
            type: string
      responses:
        '200':
          description: Array of portfolio items with token and market details
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PortfolioItemWithDetailsDto'
components:
  schemas:
    PortfolioItemWithDetailsDto:
      type: object
      properties:
        portfolioItem:
          $ref: '#/components/schemas/PortfolioItemDto'
        token:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/TokenDto'
        kalshiMarket:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/KalshiMarketDto'
      required:
        - portfolioItem
        - token
        - kalshiMarket
    PortfolioItemDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Portfolio item ID
        chainId:
          type: number
          example: 8453
          description: Chain ID
        address:
          type: string
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
          description: Wallet address
        contractAddress:
          type: string
          example: 0x...
          description: Token contract address
        tokenId:
          type: string
          example: 0x123...
          description: Token ID
        amount:
          type: string
          example: '100'
          description: Token balance
        averageFillCost:
          type: object
          example: '0.525'
          description: Average fill cost per unit in dollars
          nullable: true
        unrealizedPnL:
          type: object
          example: '12.50'
          description: Unrealized profit/loss in dollars (based on bid price)
          nullable: true
        updatedAt:
          type: string
          example: '2024-01-12T10:00:00.000Z'
          description: Last updated timestamp
      required:
        - id
        - chainId
        - address
        - contractAddress
        - tokenId
        - amount
        - averageFillCost
        - unrealizedPnL
        - updatedAt
    TokenDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Token entity ID
        chainId:
          type: number
          example: 8453
          description: Chain ID
        contractAddress:
          type: string
          example: 0x...
          description: Token contract address
        tokenId:
          type: string
          example: 0x123...
          description: Token ID
        tokenType:
          type: string
          example: erc1155
          description: Token standard
        decimals:
          type: number
          example: 0
          description: Token decimals
        tokenRepresentation:
          type: string
          example: kalshiMarket
          description: Token representation type
        metadata:
          type: object
          description: Token metadata
          example:
            marketId: KXBTC-24DEC31-T100K
            side: 'yes'
      required:
        - id
        - chainId
        - contractAddress
        - tokenId
        - tokenType
        - decimals
        - tokenRepresentation
        - metadata
    KalshiMarketDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Market entity ID
        tokenId:
          type: string
          example: 0x123...
          description: Token ID
        marketId:
          type: string
          example: KXBTC-24DEC31-T100K
          description: Market identifier
        side:
          type: string
          example: 'yes'
          description: Market side
        exchange:
          type: string
          example: Kalshi
          description: Exchange name
        name:
          type: object
          example: Will Bitcoin reach $100,000 by Dec 31?
          description: Market name
          nullable: true
        subtitle:
          type: object
          example: Bitcoin price prediction
          description: Market subtitle
          nullable: true
        marketPrice:
          type: object
          example: 45
          description: Current market price
          nullable: true
        bidPrice:
          type: object
          example: 44
          description: Current bid price
          nullable: true
        askPrice:
          type: object
          example: 46
          description: Current ask price
          nullable: true
        settledAt:
          type: string
          example: '2024-12-31T23:59:59.000Z'
          description: Settlement timestamp
          nullable: true
        createdAt:
          type: string
          example: '2024-01-01T00:00:00.000Z'
          description: Created timestamp
        updatedAt:
          type: string
          example: '2024-01-12T10:00:00.000Z'
          description: Updated timestamp
      required:
        - id
        - tokenId
        - marketId
        - side
        - exchange
        - name
        - subtitle
        - marketPrice
        - bidPrice
        - askPrice
        - settledAt
        - createdAt
        - updatedAt

````