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

# Get portfolio

> Get your current positions across all markets

## Authentication

Read authentication required — `X-Public-Key` header. See the [Authentication guide](/authentication).

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://relay.bayse.markets/v1/pm/portfolio" \
    -H "X-Public-Key: pk_live_abcdef123456"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://relay.bayse.markets/v1/pm/portfolio', {
    headers: {
      'X-Public-Key': 'pk_live_abcdef123456',
    },
  });
  const portfolio = await response.json();
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      'https://relay.bayse.markets/v1/pm/portfolio',
      headers={'X-Public-Key': 'pk_live_abcdef123456'},
  )
  portfolio = resp.json()
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://relay.bayse.markets/v1/pm/portfolio", nil)
  req.Header.Set("X-Public-Key", "pk_live_abcdef123456")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

<ResponseField name="outcomeBalances" type="array">
  Your positions across all markets.

  <Expandable title="position fields">
    <ResponseField name="id" type="string">Position UUID.</ResponseField>
    <ResponseField name="outcome" type="string">`YES` or `NO`.</ResponseField>
    <ResponseField name="outcomeId" type="string">UUID of the outcome.</ResponseField>
    <ResponseField name="assetId" type="string">Asset identifier.</ResponseField>
    <ResponseField name="balance" type="number">Total shares held.</ResponseField>
    <ResponseField name="availableBalance" type="number">Shares available to sell.</ResponseField>
    <ResponseField name="averagePrice" type="number">Average price paid per share.</ResponseField>
    <ResponseField name="cost" type="number">Total amount invested.</ResponseField>
    <ResponseField name="currentValue" type="number">Current market value of position.</ResponseField>
    <ResponseField name="sellPrice" type="number">Current price per share if sold now.</ResponseField>
    <ResponseField name="payoutIfOutcomeWins" type="number">Payout if this outcome resolves as the winner.</ResponseField>
    <ResponseField name="percentageChange" type="number">Percentage gain or loss from average price.</ResponseField>
    <ResponseField name="currency" type="string">Currency this position is denominated in.</ResponseField>
    <ResponseField name="userId" type="string">Your user UUID.</ResponseField>

    <ResponseField name="market" type="object">
      Summary of the market this position is in.

      <Expandable title="market fields">
        <ResponseField name="id" type="string">Market UUID.</ResponseField>
        <ResponseField name="title" type="string">Market question.</ResponseField>
        <ResponseField name="imageUrl" type="string">Market image.</ResponseField>
        <ResponseField name="outcome1Id" type="string">Outcome 1 UUID.</ResponseField>
        <ResponseField name="outcome2Id" type="string">Outcome 2 UUID.</ResponseField>

        <ResponseField name="event" type="object">
          Parent event summary.

          <Expandable title="event fields">
            <ResponseField name="id" type="string">Event UUID.</ResponseField>
            <ResponseField name="title" type="string">Event title.</ResponseField>
            <ResponseField name="type" type="string">`single` or `combined`.</ResponseField>
            <ResponseField name="engine" type="string">`AMM` or `CLOB`.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="portfolioCost" type="number">
  Total amount invested across all positions.
</ResponseField>

<ResponseField name="portfolioCurrentValue" type="number">
  Total current value of all positions.
</ResponseField>

<ResponseField name="portfolioPercentageChange" type="number">
  Overall portfolio gain or loss percentage.
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination information.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "outcomeBalances": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "outcome": "YES",
        "outcomeId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "balance": 138.21,
        "availableBalance": 138.21,
        "averagePrice": 0.7235,
        "cost": 100,
        "currentValue": 107.60,
        "sellPrice": 0.7786,
        "payoutIfOutcomeWins": 138.21,
        "percentageChange": 7.60,
        "currency": "USD",
        "market": {
          "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
          "title": "Will Super Eagles qualify?",
          "event": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "title": "Will Super Eagles qualify for AFCON 2026?",
            "type": "single",
            "engine": "AMM"
          }
        },
        "createdAt": "2026-02-17T12:00:00Z",
        "updatedAt": "2026-02-17T12:05:00Z"
      }
    ],
    "portfolioCost": 100,
    "portfolioCurrentValue": 107.60,
    "portfolioPercentageChange": 7.60,
    "pagination": {
      "page": 1,
      "size": 20,
      "lastPage": 1,
      "totalCount": 1
    }
  }
  ```
</ResponseExample>
