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

# Get portfolio

> Returns one account portfolio snapshot containing account-level values and the per-asset
breakdown. Quote-denominated monetary amounts use an `_in_quote` suffix; native asset
amounts omit the suffix.



## OpenAPI

````yaml /api-reference/openapi_v3_pws.json get /v1/accounts/{account_id}/portfolio
openapi: 3.1.0
info:
  title: Payward Services API
  description: >-
    The Payward Services (PWS) public API.


    PWS exposes Swaps (institutional FX-style trading), Conversion rules
    (rule-driven fiat ↔ crypto value movement), retail-style Quotes and Price
    Trigger Swaps, end-user Users / Verifications, Travel Rule address ownership
    verification, Funds (deposits, withdrawals, addresses, transactions),
    Portfolio, Earn, Reports, Webhooks, and Ramp (hosted fiat-to-crypto on-ramp
    checkout).


    All requests must be authenticated. All monetary values are decimal strings;
    all timestamps are ISO 8601 UTC. List endpoints are cursor-paginated. Errors
    follow a uniform shape (see `*ErrorResponse` schemas).
  version: v1
  contact:
    name: Payward Services API Support
    url: https://docs.payward.com
    email: api-support@payward.com
servers:
  - url: https://api.services.payward.com
    description: Production
security:
  - ApiKey: []
    ApiSign: []
    ApiNonce: []
tags:
  - name: Users
    description: >-
      User onboarding and status flows that the partner manages.


      - **Create User** provisions a user with an email and external reference.

      - **Get User** retrieves the user's profile, verification status, and
      required actions.


      Use the returned user `id` for calls that require the user's identifier.
  - name: Assets
    description: >-
      Catalog of assets available on the platform with retail-display metadata
      (logos, market data, descriptions).
  - name: Conversion rules
    x-group: Users
    description: >-
      Rule-driven fiat ↔ crypto value movement, including conversion rules and
      deposits.
  - name: On-demand conversions
    x-group: Users
    description: >-
      On-demand conversions between bank accounts and account balances, or from
      account balances to wallets.
  - name: Earn
    description: >-
      Manage auto-earn preferences and retrieve allocation and reward
      information.
  - name: Funds
    description: >-
      Deposits, withdrawals, addresses, methods, and the consolidated
      funding-transactions ledger.
  - name: Bank links
    description: >-
      Link US bank accounts to an account through a Kraken-hosted widget, then
      reference them for money movement.


      Two resources model a connection:


      - A **Bank Link** is the connection between one account and one banking
      institution. Create it to get a hosted-widget URL, and send the user there
      to choose their institution and approve access. One account can hold many
      Bank Links.

      - An **Account Link** is one bank account — a checking account, for
      example — that the user shared through that connection. One Bank Link owns
      one or more Account Links. Use `account_link_id` to reference the bank
      account when you move money.


      Both ids are opaque handles. Provider identifiers, access tokens, owner
      names, and raw bank numbers are never exposed.


      Eligibility is evaluated on every read, and ownership must match: the bank
      account's holder must match the account's verified holder. An account that
      fails ownership validation reports `ineligible` with the reason
      `name_mismatch`.


      Unlinking is permanent. Linking the same bank account again creates a new
      Bank Link and a new `account_link_id`; old ids stay valid only for reading
      history.
  - name: Portfolio
    description: 'Inspect a customer''s portfolio: balances, valuations, and transactions.'
  - name: Price trigger swaps
    description: Limit-style orders that execute when a configured price trigger is met.
  - name: On-chain swaps
    description: >-
      Wallet-funded onchain quote trading for xStock and USDC pairs. On-chain
      quotes settle on-chain through the Payward on-chain proxy contract.
  - name: Ramp
    description: >-
      Hosted fiat-to-crypto on-ramp checkout: country / fiat / payment-method /
      cryptocurrency-asset discovery, transaction limits and prospective quotes,
      and the hosted checkout URL.
  - name: Reports
    description: Settlement and reconciliation reports for the partner.
  - name: Swaps
    description: >-
      Direct partner-to-Payward swap quotes and executions (institutional
      FX-style trading).
  - name: Travel Rule verifications
    description: Travel Rule address ownership verification flows.
  - name: Verifications
    description: Identity verification (KYC) submission and status for end users.
  - name: Webhooks
    description: Manage webhook subscriptions for asynchronous event delivery.
paths:
  /v1/accounts/{account_id}/portfolio:
    get:
      tags:
        - Portfolio
      summary: Get portfolio
      description: >-
        Returns one account portfolio snapshot containing account-level values
        and the per-asset

        breakdown. Quote-denominated monetary amounts use an `_in_quote` suffix;
        native asset

        amounts omit the suffix.
      operationId: getPortfolio
      parameters:
        - in: query
          name: quote_symbol
          schema:
            description: Quote asset symbol. Defaults to `USD`.
            type: string
            minLength: 3
            maxLength: 16
          style: form
          example: USD
        - in: query
          name: quote_type
          schema:
            $ref: '#/components/schemas/QuoteAssetType'
          description: Quote asset classification. Supports fiat and stablecoin.
          style: form
          example: fiat
        - in: query
          name: with_zero_balances
          schema:
            type: boolean
            default: false
          description: >-
            Whether to include assets with zero balances. The default is false;
            omission is interpreted as false.
          style: form
          example: true
        - in: path
          name: account_id
          description: Account ID
          schema:
            type: string
          example: WX6V-JUKW-KKPB-QE36
          style: simple
          required: true
      responses:
        '200':
          description: Successful response
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Portfolio'
                required:
                  - data
              examples:
                portfolio:
                  summary: Illustrative USD-quoted snapshot
                  value:
                    data:
                      as_of: '2026-08-25T12:34:56Z'
                      quote:
                        symbol: USD
                        type: fiat
                        usd_index_rate: '1'
                      total_in_quote: '131000.00'
                      availability:
                        available_in_quote: '120000.00'
                        withheld:
                          total_in_quote: '11000.00'
                          open_orders_in_quote: '2000.00'
                          earn_in_quote: '4000.00'
                          other_in_quote: '5000.00'
                      pnl:
                        unrealized_in_quote: '3500.00'
                        realized_in_quote: '-3.7440'
                        reference_currency:
                          symbol: USD
                          type: fiat
                        status:
                          unrealized: ready
                          realized: in_progress
                      assets:
                        - symbol: BTC
                          type: crypto
                          index_price_in_quote: '62000.00'
                          balances:
                            total: '0.5'
                            total_in_quote: '31000.00'
                            main:
                              total: '0.5'
                              total_in_quote: '31000.00'
                          availability:
                            trade: '0.5'
                          pnl:
                            avg_entry_price_in_quote: '55000.00'
                            cost_basis_in_quote: '27500.00'
                            unrealized_in_quote: '3500.00'
                            reference_currency:
                              symbol: USD
                              type: fiat
                            status:
                              avg_entry_price: ready
                              cost_basis: ready
                              unrealized: ready
                              realized: in_progress
                        - symbol: USD
                          type: fiat
                          index_price_in_quote: '1'
                          balances:
                            total: '100000.00'
                            total_in_quote: '100000.00'
                            main:
                              total: '100000.00'
                              total_in_quote: '100000.00'
        '400':
          description: Validation error
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
              examples:
                invalid-request:
                  summary: Invalid request
                  value:
                    error:
                      causes:
                        - field: account_id
                          message: must be a valid account identifier
                      status: 400
                      code: bad_request
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '401':
          description: Authentication required
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
              examples:
                authentication-failed:
                  summary: Authentication failed
                  value:
                    error:
                      code: unauthenticated
                      status: 401
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '403':
          description: Forbidden
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
              examples:
                caller-is-not-allowed:
                  summary: Caller is not allowed
                  value:
                    error:
                      code: forbidden
                      status: 403
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '404':
          description: Not found
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
              examples:
                not-found:
                  summary: Resource not found
                  value:
                    error:
                      code: not_found
                      status: 404
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '429':
          description: Rate limit exceeded
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceExhaustedError'
              examples:
                rate-limit-exceeded:
                  summary: Rate limit exceeded
                  value:
                    error:
                      code: resource_exhausted
                      status: 429
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '500':
          description: Internal server error
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
              examples:
                internal-error:
                  summary: Internal server error
                  value:
                    error:
                      code: internal
                      status: 500
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '501':
          description: Error response
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnimplementedError'
              examples:
                not-implemented:
                  summary: Operation is not implemented
                  value:
                    error:
                      code: unimplemented
                      status: 501
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '503':
          description: Service unavailable
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnavailableError'
              examples:
                service-unavailable:
                  summary: Service unavailable
                  value:
                    error:
                      code: unavailable
                      status: 503
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
        '504':
          description: Deadline exceeded
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeadlineExceededError'
              examples:
                request-deadline-exceeded:
                  summary: Request deadline exceeded
                  value:
                    error:
                      code: deadline_exceeded
                      status: 504
                      type: portfolio_error
                      instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
      security:
        - ApiKey: []
          ApiSign: []
          ApiNonce: []
components:
  schemas:
    QuoteAssetType:
      description: Quote asset classification. Supports fiat and stablecoin.
      type: string
      enum:
        - fiat
        - stablecoin
    Portfolio:
      description: A unified account portfolio snapshot.
      type: object
      properties:
        as_of:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          description: Time of the latest index-price update represented by this snapshot.
        quote:
          $ref: '#/components/schemas/PortfolioQuote'
        total_in_quote:
          description: Total account value in the portfolio quote.
          type: string
        availability:
          $ref: '#/components/schemas/PortfolioAvailability'
        pnl:
          $ref: '#/components/schemas/PortfolioPnl'
        assets:
          description: >-
            Per-asset portfolio breakdown. Always present and empty when there
            are no assets.
          type: array
          items:
            $ref: '#/components/schemas/PortfolioAsset'
      required:
        - as_of
        - quote
        - total_in_quote
        - availability
        - assets
    BadRequestError:
      description: Request validation failed or the request could not be processed.
      allOf:
        - $ref: '#/components/schemas/PwsValidationErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsValidationError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 400
                    code:
                      type: string
                      enum:
                        - bad_request
    UnauthenticatedError:
      description: Authentication credentials are missing, invalid, or not accepted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 401
                    code:
                      type: string
                      enum:
                        - unauthenticated
    ForbiddenError:
      description: The caller is not allowed to perform this operation.
      oneOf:
        - title: Forbidden
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        status:
                          type: integer
                          format: int32
                          enum:
                            - 403
                        code:
                          type: string
                          enum:
                            - forbidden
        - $ref: '#/components/schemas/GatewayError'
    NotFoundError:
      description: Requested resource is not available to the selected account.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/NotFoundErrorDetail'
    ResourceExhaustedError:
      description: The request was rate limited or a resource quota was exhausted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 429
                    code:
                      type: string
                      enum:
                        - resource_exhausted
    InternalError:
      description: An unexpected server-side error occurred.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 500
                    code:
                      type: string
                      enum:
                        - internal
    UnimplementedError:
      description: The operation is not implemented by the upstream service.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 501
                    code:
                      type: string
                      enum:
                        - unimplemented
    UnavailableError:
      description: The service is temporarily unavailable.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 503
                    code:
                      type: string
                      enum:
                        - unavailable
    DeadlineExceededError:
      description: The upstream service did not complete the request before the deadline.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      enum:
                        - 504
                    code:
                      type: string
                      enum:
                        - deadline_exceeded
    google.protobuf.Timestamp:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    PortfolioQuote:
      description: Currency used for monetary values throughout the portfolio snapshot.
      type: object
      properties:
        symbol:
          description: Public quote-asset symbol.
          type: string
          example: USD
        type:
          $ref: '#/components/schemas/QuoteAssetType'
        usd_index_rate:
          description: USD value of one unit of this quote asset. Omitted when unavailable.
          type: string
          example: '1.14'
      required:
        - symbol
        - type
    PortfolioAvailability:
      description: Account-level availability and holds in the portfolio quote.
      type: object
      properties:
        available_in_quote:
          description: Funds available for trading or withdrawal after holds.
          type: string
        withheld:
          $ref: '#/components/schemas/PortfolioWithheld'
      required:
        - available_in_quote
        - withheld
    PortfolioPnl:
      description: Account-level average-cost-basis PnL in the portfolio quote.
      type: object
      properties:
        reference_currency:
          $ref: '#/components/schemas/PnlReferenceCurrency'
        unrealized_in_quote:
          description: Lots-based unrealized PnL.
          type: string
        realized_in_quote:
          description: Realized PnL.
          type: string
        cost_basis_in_quote:
          description: Total cost basis.
          type: string
        status:
          $ref: '#/components/schemas/PnlProcessingStatus'
    PortfolioAsset:
      description: Portfolio data for one asset.
      type: object
      properties:
        symbol:
          description: Public asset symbol.
          type: string
        type:
          $ref: '#/components/schemas/AssetType'
        index_price_in_quote:
          description: Price of one unit of the asset in the top-level portfolio quote.
          type: string
        balances:
          $ref: '#/components/schemas/PortfolioBalances'
        held_for_orders:
          $ref: '#/components/schemas/PortfolioHeldForOrders'
        earn:
          $ref: '#/components/schemas/PortfolioEarn'
        availability:
          $ref: '#/components/schemas/PortfolioAssetAvailability'
        credit_line:
          $ref: '#/components/schemas/PortfolioCreditLine'
        spot_margin:
          $ref: '#/components/schemas/PortfolioSpotMargin'
        pnl:
          $ref: '#/components/schemas/PortfolioAssetPnl'
      required:
        - symbol
        - type
        - balances
    PwsValidationErrorEnvelope:
      description: Error envelope for request validation failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsValidationError'
          description: Validation error details.
    PwsValidationError:
      description: Standard PWS API error object for request validation failures.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
        causes:
          description: Validation failures that contributed to the error.
          type: array
          items:
            $ref: '#/components/schemas/PwsErrorCause'
    PwsGeneralErrorEnvelope:
      description: Error envelope for operational or domain failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsGeneralError'
          description: General error details.
    PwsGeneralError:
      description: Standard PWS API error object for non-validation failures.
      allOf:
        - $ref: '#/components/schemas/PwsErrorBase'
        - type: object
          properties:
            causes:
              description: Additional error details, when present.
              type: array
              items:
                type: object
                additionalProperties: true
    GatewayError:
      title: Gateway
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - status
            - code
          properties:
            type:
              type: string
              const: service_error
            status:
              type: integer
              format: int32
              const: 403
            code:
              type: string
              const: gateway
    NotFoundErrorDetail:
      description: Structured resource-not-found error details.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class for the API that handled the request.
          type: string
          enum:
            - funding_error
            - portfolio_error
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
          enum:
            - 404
        instance:
          description: Request identifier for this error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
          enum:
            - not_found
        doc_url:
          description: Link to documentation for this error, when available.
          type: string
          format: uri
        causes:
          description: Field-level causes for validation errors, when available.
          type: array
          items:
            $ref: '#/components/schemas/ErrorCause'
    PortfolioWithheld:
      description: >-
        Funds unavailable because of orders, earn allocation, or other temporary
        holds.
      type: object
      properties:
        total_in_quote:
          description: Total withheld value.
          type: string
        open_orders_in_quote:
          description: Total value held for open orders.
          type: string
        earn_in_quote:
          description: Value withheld for earn products.
          type: string
        other_in_quote:
          description: >-
            Other temporary holds such as card holds, paylinks, or pending
            movements.
          type: string
      required:
        - total_in_quote
        - open_orders_in_quote
        - earn_in_quote
        - other_in_quote
    PnlReferenceCurrency:
      description: Currency Portfolio uses as the PnL calculation basis.
      type: object
      properties:
        symbol:
          description: Public symbol of the PnL reference currency.
          type: string
        type:
          $ref: '#/components/schemas/AssetType'
      required:
        - symbol
        - type
    PnlProcessingStatus:
      description: Readiness of average-cost-basis calculations.
      type: object
      properties:
        avg_entry_price:
          $ref: '#/components/schemas/PnlProcessingState'
        cost_basis:
          $ref: '#/components/schemas/PnlProcessingState'
        unrealized:
          $ref: '#/components/schemas/PnlProcessingState'
        realized:
          $ref: '#/components/schemas/PnlProcessingState'
    AssetType:
      description: Asset classification for portfolio resources.
      type: string
      enum:
        - fiat
        - crypto
        - xstock
        - stablecoin
        - equity
    PortfolioBalances:
      description: >-
        Asset balance and its value in the top-level portfolio quote, with
        optional breakdowns by

        account balance source. `main` includes balances used by spot trading
        and balances received

        from swaps; it is not a transaction-origin classification. `total` is
        the native-asset sum

        of all balance sources, and `total_in_quote` is the quoted value of that
        same total.
      type: object
      properties:
        total:
          description: >-
            Total balance across all sources in the asset's native display
            units.
          type: string
        total_in_quote:
          description: Value of the total balance in the top-level portfolio quote.
          type: string
        main:
          $ref: '#/components/schemas/PortfolioBalance'
        custody_pledged_collateral:
          $ref: '#/components/schemas/PortfolioBalance'
        custody_otc_trading:
          $ref: '#/components/schemas/PortfolioBalance'
        dual_currency_investment:
          $ref: '#/components/schemas/PortfolioBalance'
        custody_staking:
          $ref: '#/components/schemas/PortfolioBalance'
        kraken_launch:
          $ref: '#/components/schemas/PortfolioBalance'
      required:
        - total
    PortfolioHeldForOrders:
      description: Native asset amounts held for open orders.
      type: object
      properties:
        main:
          $ref: '#/components/schemas/PortfolioAmount'
        equities:
          $ref: '#/components/schemas/PortfolioAmount'
    PortfolioEarn:
      description: Earn balances grouped by strategy liquidity.
      type: object
      properties:
        locked:
          $ref: '#/components/schemas/PortfolioEarnBalance'
        flex:
          $ref: '#/components/schemas/PortfolioEarnBalance'
        hybrid:
          $ref: '#/components/schemas/PortfolioEarnBalance'
    PortfolioAssetAvailability:
      description: Asset amounts available for specific actions.
      type: object
      properties:
        trade:
          description: Amount available for trading, in the asset's native display units.
          type: string
        transfer:
          description: >-
            Amount available for internal transfer, in the asset's native
            display units.
          type: string
    PortfolioCreditLine:
      description: Credit usage and total limit. Remaining credit is limit minus used.
      type: object
      properties:
        used:
          $ref: '#/components/schemas/PortfolioAmount'
        limit:
          $ref: '#/components/schemas/PortfolioAmount'
    PortfolioSpotMargin:
      description: Per-asset spot-margin values in the top-level portfolio quote.
      type: object
      properties:
        collateral_value_in_quote:
          description: Discounted asset value used as collateral.
          type: string
        collateral_adjustment_in_quote:
          description: Collateral haircut applied to this asset.
          type: string
        initial_margin_in_quote:
          description: Initial margin requirement attributable to this asset.
          type: string
        maintenance_margin_in_quote:
          description: Maintenance margin requirement attributable to this asset.
          type: string
        liquidation_margin_in_quote:
          description: Liquidation margin requirement attributable to this asset.
          type: string
        held_margin_in_quote:
          description: Margin held for positions and open spot-margin orders.
          type: string
        position_cost_basis_in_quote:
          description: Total cost basis of open spot-margin positions.
          type: string
        unrealized_pnl_in_quote:
          description: >-
            Position-based unrealized PnL, distinct from lots-based portfolio
            PnL.
          type: string
    PortfolioAssetPnl:
      description: Per-asset average-cost-basis PnL in the top-level portfolio quote.
      type: object
      properties:
        reference_currency:
          $ref: '#/components/schemas/PnlReferenceCurrency'
        unrealized_in_quote:
          description: Lots-based unrealized PnL.
          type: string
        realized_in_quote:
          description: Realized PnL.
          type: string
        cost_basis_in_quote:
          description: Total value spent to acquire the current balance.
          type: string
        avg_entry_price_in_quote:
          description: Volume-weighted average acquisition price.
          type: string
        status:
          $ref: '#/components/schemas/PnlProcessingStatus'
    PwsErrorCause:
      description: A single request validation failure.
      type: object
      required:
        - field
        - message
      properties:
        field:
          description: Dot-notation path to the offending request field.
          type: string
        message:
          description: Human-readable explanation of the failed validation rule.
          type: string
    PwsErrorBase:
      description: Common fields present on every PWS API error object.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
    ErrorCause:
      description: Field-level validation failure.
      type: object
      required:
        - field
        - message
      properties:
        field:
          description: Request field that failed validation.
          type: string
        message:
          description: Human-readable explanation of the validation failure.
          type: string
    PnlProcessingState:
      description: >-
        Processing state for a PnL calculation. `ready` means the value is
        complete. `in_progress` means calculation is still running, and the
        corresponding value may be absent or not final.
      type: string
      enum:
        - ready
        - in_progress
    PortfolioBalance:
      description: Balance held in one account balance source.
      type: object
      properties:
        total:
          description: Balance in the asset's native display units.
          type: string
        total_in_quote:
          description: Value of the balance in the top-level portfolio quote.
          type: string
      required:
        - total
    PortfolioAmount:
      description: An amount in the asset's native display units.
      type: object
      properties:
        amount:
          description: Balance in the asset's native display units.
          type: string
      required:
        - amount
    PortfolioEarnBalance:
      description: >-
        Two views of the same earn total: lifecycle state and yield source. Do
        not add the

        lifecycle and yield-source breakdowns together.
      type: object
      properties:
        total:
          $ref: '#/components/schemas/PortfolioAmount'
        earning:
          $ref: '#/components/schemas/PortfolioAmount'
        bonding:
          $ref: '#/components/schemas/PortfolioAmount'
        unbonding:
          $ref: '#/components/schemas/PortfolioAmount'
        exit_queue:
          $ref: '#/components/schemas/PortfolioAmount'
        by_yield_source:
          $ref: '#/components/schemas/PortfolioEarnYieldSources'
    PortfolioEarnYieldSources:
      description: Earn total decomposed by yield source.
      type: object
      properties:
        staking:
          $ref: '#/components/schemas/PortfolioAmount'
        opt_in_rewards:
          $ref: '#/components/schemas/PortfolioAmount'
        base_rewards:
          $ref: '#/components/schemas/PortfolioAmount'
  headers:
    TraceId:
      description: Trace identifier for the request. Include it when contacting support.
      schema:
        type: string
        example: 4bf92f3577b34da6a3ce929d0e0e4736
    StrictTransportSecurity:
      description: >-
        Enforces HTTPS for the configured period. Always `max-age=63072000;
        includeSubDomains; preload`.
      schema:
        type: string
        example: max-age=63072000; includeSubDomains; preload
    CacheControl:
      description: Prevents caching of sensitive financial data. Always `no-store`.
      schema:
        type: string
        enum:
          - no-store
        example: no-store
  securitySchemes:
    ApiKey:
      type: apiKey
      name: API-Key
      in: header
      description: Your public API key. Identifies the partner making the request.
    ApiSign:
      type: apiKey
      name: API-Sign
      in: header
      description: HMAC signature over the request, computed with your private key.
    ApiNonce:
      type: apiKey
      name: API-Nonce
      in: header
      description: Monotonically increasing nonce included in the request signature.

````