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

# Portfolio

> Get portfolio summary with exposure and concentration metrics. Returns per-venue buckets (polymarket, kalshi), totals, concentration metrics, and warnings.

Get portfolio summary with exposure and concentration metrics.

## Overview

Returns aggregated portfolio data including:

* **Per-venue buckets**: `polymarket`, `kalshi` — each with balance, pnl, positions\_count, total\_exposure
* **`total`**: summed counts and exposure across venues (units are mixed — use per-venue buckets for financially accurate aggregation)
* **Flat legacy fields** (`balance_usdc`, `positions_count`, etc.) kept populated for backwards compatibility
* **Concentration metrics**: top market and top 3 markets as percentage of portfolio
* **Warnings**: automatic risk alerts (e.g. high concentration)

### Query Parameters

| Param   | Type   | Default | Description                                                                 |
| ------- | ------ | ------- | --------------------------------------------------------------------------- |
| `venue` | string | `all`   | `all`, `polymarket`, or `kalshi`. Filters which venue buckets are computed. |

<Tip>
  **Venue-aware response.** The `polymarket`, `kalshi`, and `total` buckets are the preferred shape. Use `?venue=polymarket` or `?venue=kalshi` to filter. The legacy flat fields (`balance_usdc`, `positions_count`, `total_exposure`) remain populated for backwards compatibility, but `positions_count` only counts Polymarket positions — use the per-venue buckets for accurate counts.
</Tip>

## Example

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl -X GET "https://www.aionmarket.com/bvapi/markets/portfolio?venue=all" \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Tab>

  <Tab title="Python SDK">
    ```python theme={null}
    from aion_sdk import AionMarketClient

    client = AionMarketClient(api_key="YOUR_API_KEY")

    # Full portfolio across all venues
    portfolio = client.get_portfolio()

    # Kalshi-only
    kalshi_portfolio = client.get_portfolio(venue="kalshi")
    ```
  </Tab>
</Tabs>

## Response Example

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "balance_usdc": 523.50,
    "total_exposure": 350.00,
    "positions_count": 5,
    "redeemable_count": 1,
    "pnl_total": 45.20,
    "concentration": {
      "top_market_pct": 32.5,
      "top_3_markets_pct": 78.1
    },
    "warnings": [],
    "polymarket": {
      "balance": 400.00,
      "pnl": 35.50,
      "positions_count": 5,
      "total_exposure": 250.00
    },
    "kalshi": {
      "balance": 123.50,
      "pnl": 9.70,
      "positions_count": 3,
      "total_exposure": 100.00
    },
    "total": {
      "positions_count": 8,
      "total_exposure": 350.00
    }
  }
}
```


## OpenAPI

````yaml GET /markets/portfolio
openapi: 3.1.0
info:
  title: Aion AI Agent API
  description: >-
    API for agent registration, wallet onboarding, market discovery, order
    management, and execution on Aion.
  version: 1.0.0
  contact:
    name: Aion Support
    email: info@aionmarket.com
    url: https://docs.aionmarket.com
servers:
  - url: https://www.aionmarket.com/bvapi
    description: Aion API
security:
  - bearerAuth: []
tags:
  - name: Agent Management
  - name: Market Operations
  - name: Order Management
  - name: Trading
  - name: Kalshi
  - name: Skills
  - name: Wallet Management
  - name: Trades & Leaderboard
  - name: Utilities
  - name: Settings
  - name: Positions & Portfolio
  - name: Fee Charging
paths:
  /markets/portfolio:
    get:
      tags:
        - Positions & Portfolio
      summary: Portfolio
      description: >-
        Get portfolio summary with exposure and concentration metrics. Returns
        per-venue buckets (polymarket, kalshi), totals, concentration metrics,
        and warnings.
      operationId: portfolio
      parameters:
        - name: venue
          in: query
          required: false
          schema:
            type: string
            default: all
            enum:
              - all
              - polymarket
              - kalshi
          description: >-
            Venue filter: all, polymarket, or kalshi. Per-venue buckets reflect
            this filter.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioResponse'
components:
  schemas:
    PortfolioResponse:
      type: object
      properties:
        balance_usdc:
          type: number
          nullable: true
          example: 523.5
          description: Total USDC balance (legacy)
        total_exposure:
          type: number
          nullable: true
          example: 350
          description: Total exposure (legacy)
        positions_count:
          type: integer
          nullable: true
          example: 5
          description: Open positions count (legacy – Polymarket only)
        redeemable_count:
          type: integer
          nullable: true
          example: 2
          description: Redeemable positions count
        pnl_24h:
          type: number
          nullable: true
          description: PnL in the last 24h
        pnl_total:
          type: number
          nullable: true
          example: 100.5
          description: Total all-time PnL
        concentration:
          $ref: '#/components/schemas/PortfolioConcentration'
        warnings:
          type: array
          items:
            type: string
          description: Risk warnings
        polymarket:
          $ref: '#/components/schemas/PortfolioVenueBucket'
        kalshi:
          $ref: '#/components/schemas/PortfolioVenueBucket'
        total:
          $ref: '#/components/schemas/PortfolioTotal'
    PortfolioConcentration:
      type: object
      properties:
        top_market_pct:
          type: number
          example: 25.3
          description: Top market % of portfolio
        top_3_markets_pct:
          type: number
          example: 60.1
          description: Top 3 markets % of portfolio
    PortfolioVenueBucket:
      type: object
      properties:
        balance:
          type: number
          example: 123
          description: Balance in venue native currency
        pnl:
          type: number
          example: 15.5
          description: PnL for this venue
        positions_count:
          type: integer
          example: 5
          description: Number of open positions
        total_exposure:
          type: number
          example: 200
          description: Total exposure in venue currency
    PortfolioTotal:
      type: object
      properties:
        positions_count:
          type: integer
          example: 10
          description: Summed position count across venues
        total_exposure:
          type: number
          example: 350
          description: Summed exposure (mixed currency)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-default: YOUR_API_KEY

````