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

# Aggregate portfolio view

> Single-call dashboard payload: vault info, balances, positions, fee tier, and any active reality-check state for the caller. One-shot endpoint backing the user dashboard — saves a 4-request fan-out. Sub-endpoints (`/me/balances`, `/me/positions`, `/me/vault`, `/me/fee-tier`) remain available for targeted refreshes.



## OpenAPI

````yaml /api-reference/openapi.json get /api/me/portfolio
openapi: 3.1.0
info:
  title: PredictStreet core-api
  description: >-
    Client-facing HTTP gateway for the PredictStreet prediction-market platform.
    This spec is hand-written against the NestJS controllers and DTOs in
    core-api/src/modules/. For the source-of-truth live spec, run
    `./scripts/pull-openapi.sh` against a running core-api (NestJS exposes it at
    /api/docs-json). **Partner kinds.** Every authenticated endpoint resolves a
    request's *effective wallet* from the partner row. `single_wallet` partners
    bind to one `associatedWallet` set at creation. `multi_wallet` partners
    declare the actor on every request via an `X-User-Wallet: 0x<40-hex>`
    header. See the [Partner kinds](/auth/api-keys#partner-kinds) doc for the
    full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core.api.dev.predictstreet.sde.adifoundation.ai
    description: Testnet (partner integrator API — final domain TBD)
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      admin.matches aggregate — groups several events into one fixture/card (1X2
      + first-scorer + over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the frontend (Privy JWT) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
paths:
  /api/me/portfolio:
    get:
      tags:
        - Portfolio
      summary: Aggregate portfolio view
      description: >-
        Single-call dashboard payload: vault info, balances, positions, fee
        tier, and any active reality-check state for the caller. One-shot
        endpoint backing the user dashboard — saves a 4-request fan-out.
        Sub-endpoints (`/me/balances`, `/me/positions`, `/me/vault`,
        `/me/fee-tier`) remain available for targeted refreshes.
      operationId: PortfolioController_portfolio
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioAggregateRespDto'
      security:
        - ApiKey: []
        - access: []
components:
  schemas:
    PortfolioAggregateRespDto:
      type: object
      properties:
        walletAddress:
          type: string
        vault:
          type: object
          description: Vault address + deployment status.
          additionalProperties: true
        balances:
          type: array
          items:
            $ref: '#/components/schemas/BalanceDto'
        positions:
          type: array
          items:
            $ref: '#/components/schemas/PositionDto'
        feeTier:
          $ref: '#/components/schemas/FeeTierDto'
        realityCheck:
          type: object
          description: Reality-check session state (responsible-gambling rolling window).
          additionalProperties: true
          nullable: true
      required:
        - walletAddress
        - vault
        - balances
        - positions
        - feeTier
        - realityCheck
    BalanceDto:
      type: object
      properties:
        token:
          type: string
          description: Token symbol (currently USDC).
        available:
          type: string
          description: Spendable balance (decimal string).
        unsettled:
          type: string
          description: Pending settlement, not yet usable (decimal string).
        locked:
          type: string
          description: Currently locked by open orders (decimal string).
        quarantined:
          type: string
          description: Quarantined by compliance hold (decimal string).
      required:
        - token
        - available
        - unsettled
        - locked
        - quarantined
    PositionDto:
      type: object
      properties:
        marketId:
          type: string
        marketSymbol:
          type: string
        marketTitle:
          type: object
          nullable: true
        eventId:
          type: object
          nullable: true
        eventTitle:
          type: object
          nullable: true
        matchId:
          type: object
          nullable: true
        matchTitle:
          type: object
          nullable: true
        participantA:
          type: object
          nullable: true
        participantB:
          type: object
          nullable: true
        kickoff:
          type: object
          nullable: true
          description: ISO-8601 kickoff.
        outcome:
          type: string
          description: Outcome index as string (kept for backward-compat).
        outcomeIndex:
          type: object
          nullable: true
        outcomeLabel:
          type: object
          nullable: true
          description: Human label (YES/NO/custom).
        status:
          type: string
          enum:
            - open
            - won
            - lost
        quantity:
          type: object
          nullable: true
          description: Live position quantity (decimal string).
        avgCost:
          type: object
          nullable: true
          description: >-
            Weighted average entry cost per share (decimal string). null when
            accounting state is `unavailable`.
        currentPrice:
          type: object
          nullable: true
          description: Current outcome-token price (decimal string).
        costBasis:
          type: object
          nullable: true
          description: Total spent acquiring the position (decimal string).
        markValue:
          type: object
          nullable: true
          description: quantity × currentPrice (decimal string).
        realizedPnl:
          type: object
          nullable: true
          description: Realised P&L from sells (decimal string).
        unrealizedPnl:
          type: object
          nullable: true
          description: markValue − costBasis (decimal string).
        payoutIfCorrect:
          type: object
          nullable: true
          description: Total payout if this outcome wins (decimal string).
        pricingStatus:
          type: string
          enum:
            - exact
            - unavailable
          description: >-
            exact when current price was looked up; unavailable on cache+SQL
            miss.
        accountingStatus:
          type: string
          enum:
            - exact
            - unavailable
          description: >-
            exact when full trade history was found; unavailable on partial
            accounting.
      required:
        - marketId
        - marketSymbol
        - marketTitle
        - eventId
        - eventTitle
        - matchId
        - matchTitle
        - participantA
        - participantB
        - kickoff
        - outcome
        - outcomeIndex
        - outcomeLabel
        - status
        - quantity
        - avgCost
        - currentPrice
        - costBasis
        - markValue
        - realizedPnl
        - unrealizedPnl
        - payoutIfCorrect
        - pricingStatus
        - accountingStatus
    FeeTierDto:
      type: object
      properties:
        tier:
          type: number
          description: Tier number (1-based, higher = better fees).
        makerBps:
          type: number
          description: Maker fee bps (always 0 by platform policy).
        takerBps:
          type: number
          description: Taker fee bps for the wallet at this tier.
        rolling30dVolume:
          type: string
          description: Rolling 30-day matched notional (decimal string).
        nextTierVolume:
          type: string
          nullable: true
          description: >-
            Trailing-30-day taker volume threshold for the next tier (decimal
            USDC). Null when the wallet is already at the top tier.
      required:
        - tier
        - makerBps
        - takerBps
        - rolling30dVolume

````