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

# List position events

> Returns the fill ledger used to project one asset's weighted-average cost
basis and realised PnL, newest first. Requires the `ACCOUNT_READ` scope.




## OpenAPI

````yaml /openapi.yaml get /portfolio/positions/{asset}/events
openapi: 3.1.0
info:
  title: PaperDrill REST API
  version: 1.0.0
  description: >
    Trade PaperDrill credit markets and read live market data.


    Prices, quantities, balances, and other decimal values are encoded as
    strings so clients do not lose precision.
servers:
  - url: https://api.paperdrill.dev/v1
    description: Production
security: []
tags:
  - name: Market data
    description: Public markets, tickers, candles, trades, and order-book snapshots.
  - name: Trading
    description: Create, inspect, and cancel orders with a scoped API key.
  - name: Account
    description: Read balances, portfolio performance, and private trade history.
  - name: Leaderboard
    description: Live public standings and your personal ranking.
  - name: Rewards
    description: >-
      Starter and daily simulated-fund credit status and claims for signed-in
      users.
paths:
  /portfolio/positions/{asset}/events:
    get:
      tags:
        - Account
      summary: List position events
      description: >
        Returns the fill ledger used to project one asset's weighted-average
        cost

        basis and realised PnL, newest first. Requires the `ACCOUNT_READ` scope.
      operationId: listPortfolioPositionEvents
      parameters:
        - $ref: '#/components/parameters/AssetPath'
        - name: page
          in: query
          description: Page number, starting at 1.
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          description: Number of events per page.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Position events returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioPositionEvents'
        default:
          $ref: '#/components/responses/RequestError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    AssetPath:
      name: asset
      in: path
      required: true
      description: Asset code. Matching is case-insensitive.
      schema:
        type: string
      example: BTC
  schemas:
    PortfolioPositionEvents:
      type: object
      required:
        - asset
        - quoteAsset
        - events
        - pagination
      properties:
        asset:
          type: string
        quoteAsset:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioPositionEvent'
        pagination:
          $ref: '#/components/schemas/Pagination'
    PortfolioPositionEvent:
      type: object
      required:
        - id
        - fillId
        - symbol
        - side
        - price
        - qty
        - quoteAmount
        - costBasisBefore
        - costBasisAfter
        - realizedPnl
        - occurredAt
      properties:
        id:
          type: string
        fillId:
          type: string
        symbol:
          type: string
        side:
          $ref: '#/components/schemas/Side'
        price:
          $ref: '#/components/schemas/DecimalString'
        qty:
          $ref: '#/components/schemas/DecimalString'
        quoteAmount:
          $ref: '#/components/schemas/DecimalString'
        costBasisBefore:
          $ref: '#/components/schemas/SignedDecimalString'
        costBasisAfter:
          $ref: '#/components/schemas/SignedDecimalString'
        realizedPnl:
          $ref: '#/components/schemas/SignedDecimalString'
        occurredAt:
          type: string
          format: date-time
    Pagination:
      type: object
      required:
        - page
        - limit
        - total
        - totalPages
        - hasNextPage
        - hasPreviousPage
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        totalPages:
          type: integer
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
    ApiError:
      type: object
      required:
        - error
        - requestId
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiErrorDetail'
        requestId:
          type: string
          format: uuid
      example:
        error:
          code: VALIDATION_ERROR
          message: Request validation failed
          details:
            - field: qty
              message: invalid decimal format
        requestId: f4c0baf4-b8d2-4c9a-a17b-c8656c4a7b0e
    Side:
      type: string
      enum:
        - BUY
        - SELL
    DecimalString:
      type: string
      pattern: ^\d+(\.\d+)?$
      description: A non-negative decimal encoded as a string.
      example: '125.50'
    SignedDecimalString:
      type: string
      pattern: ^[+-]?\d+(\.\d+)?$
      description: A signed decimal encoded as a string.
      example: '+3.40'
    ApiErrorDetail:
      type: object
      required:
        - message
      properties:
        field:
          type: string
        message:
          type: string
  responses:
    RequestError:
      description: The request failed. See Errors and rate limits for recovery guidance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A scoped API key created in the PaperDrill dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.