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

# Get activities

> Get activities for a user including trades, position resolutions, and account balance changes



## OpenAPI

````yaml api-reference/oapi-schemas/portfolio-schema.json get /v1/portfolio/activities
openapi: 3.0.1
info:
  title: Portfolio API
  description: Portfolio and activity endpoints for tracking positions and trading history
  version: v1.0.0
servers:
  - url: https://api.polymarket.us
security: []
tags:
  - name: Portfolio
paths:
  /v1/portfolio/activities:
    get:
      tags:
        - Portfolio
      summary: Get activities
      description: >-
        Get activities for a user including trades, position resolutions, and
        account balance changes
      operationId: PortfolioService_GetActivities
      parameters:
        - name: limit
          in: query
          description: Maximum number of activities to return
          required: false
          schema:
            type: integer
            format: int32
        - name: cursor
          in: query
          description: Pagination cursor from previous response
          required: false
          schema:
            type: string
        - name: marketSlug
          in: query
          description: Market slug to filter upon
          required: false
          schema:
            type: string
        - name: types
          in: query
          description: Types of activities to filter upon
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVITY_TYPE_TRADE
                - ACTIVITY_TYPE_POSITION_RESOLUTION
                - ACTIVITY_TYPE_ACCOUNT_DEPOSIT
                - ACTIVITY_TYPE_ACCOUNT_ADVANCED_DEPOSIT
                - ACTIVITY_TYPE_ACCOUNT_WITHDRAWAL
                - ACTIVITY_TYPE_REFERRAL_BONUS
                - ACTIVITY_TYPE_TRANSFER
        - name: sortOrder
          in: query
          description: Sort order for the activities
          required: false
          schema:
            type: string
            enum:
              - SORT_ORDER_DESCENDING
              - SORT_ORDER_ASCENDING
      responses:
        '200':
          description: List of activities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActivitiesResponse'
        '401':
          description: Unauthorized - invalid or missing API key
        '500':
          description: Internal server error
components:
  schemas:
    GetActivitiesResponse:
      type: object
      properties:
        activities:
          type: array
          items:
            $ref: '#/components/schemas/Activity'
          description: List of activities
        nextCursor:
          type: string
          description: Pagination cursor for next page
        eof:
          type: boolean
          description: True if this is the last page
    Activity:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ActivityType'
        trade:
          $ref: '#/components/schemas/Trade'
        positionResolution:
          $ref: '#/components/schemas/PositionResolution'
        accountBalanceChange:
          $ref: '#/components/schemas/AccountBalanceChange'
      description: Activity record
    ActivityType:
      type: string
      enum:
        - ACTIVITY_TYPE_TRADE
        - ACTIVITY_TYPE_POSITION_RESOLUTION
        - ACTIVITY_TYPE_ACCOUNT_DEPOSIT
        - ACTIVITY_TYPE_ACCOUNT_ADVANCED_DEPOSIT
        - ACTIVITY_TYPE_ACCOUNT_WITHDRAWAL
        - ACTIVITY_TYPE_REFERRAL_BONUS
        - ACTIVITY_TYPE_TRANSFER
      description: Type of activity
    Trade:
      type: object
      properties:
        id:
          type: string
          description: Exchange-assigned trade ID
        marketSlug:
          type: string
          description: Market slug
        state:
          type: string
          enum:
            - TRADE_STATE_NEW
            - TRADE_STATE_CLEARED
            - TRADE_STATE_BUSTED
            - TRADE_STATE_INFLIGHT
            - TRADE_STATE_PENDING_RISK
            - TRADE_STATE_PENDING_CLEARED
            - TRADE_STATE_REJECTED
          description: State of the trade
        createTime:
          type: string
          format: date-time
          description: Creation timestamp
        updateTime:
          type: string
          format: date-time
          description: Last update timestamp
        price:
          $ref: '#/components/schemas/Amount'
          description: Trade price
        qty:
          type: string
          description: Trade quantity
        isAggressor:
          type: boolean
          description: True if user's order was the taker
        costBasis:
          $ref: '#/components/schemas/Amount'
          nullable: true
          description: Cost basis for the trade
        realizedPnl:
          $ref: '#/components/schemas/Amount'
          nullable: true
          description: Realized profit and loss
    PositionResolution:
      type: object
      properties:
        marketSlug:
          type: string
          description: Market slug
        beforePosition:
          $ref: '#/components/schemas/UserPosition'
          description: Position before resolution
        afterPosition:
          $ref: '#/components/schemas/UserPosition'
          description: Position after resolution
        updateTime:
          type: string
          format: date-time
          description: Resolution timestamp
        tradeId:
          type: string
          description: Associated trade ID
        side:
          type: string
          enum:
            - POSITION_RESOLUTION_SIDE_LONG
            - POSITION_RESOLUTION_SIDE_SHORT
            - POSITION_RESOLUTION_SIDE_NEUTRAL
          description: Side of resolution
    AccountBalanceChange:
      type: object
      properties:
        transactionId:
          type: string
          description: Transaction ID
        status:
          type: string
          enum:
            - ACCOUNT_BALANCE_CHANGE_STATUS_PENDING
            - ACCOUNT_BALANCE_CHANGE_STATUS_COMPLETED
            - ACCOUNT_BALANCE_CHANGE_STATUS_PARTIALLY_REFUNDED
            - ACCOUNT_BALANCE_CHANGE_STATUS_REJECTED
          description: Status of the balance change
        amount:
          $ref: '#/components/schemas/Amount'
          description: Amount of the balance change
        updateTime:
          type: string
          format: date-time
          description: Last update time
        createTime:
          type: string
          format: date-time
          description: Creation time
    Amount:
      type: object
      required:
        - value
        - currency
      properties:
        value:
          type: string
          format: decimal
          example: '123.45'
          description: The amount as a decimal string
        currency:
          type: string
          description: The currency code
      description: Represents a monetary amount with its currency
    UserPosition:
      type: object
      properties:
        netPosition:
          type: string
          format: int64
          description: Net position quantity (positive for long, negative for short)
        qtyBought:
          type: string
          format: int64
          description: Total quantity bought
        qtySold:
          type: string
          format: int64
          description: Total quantity sold
        cost:
          $ref: '#/components/schemas/Amount'
          description: Total cost basis
        realized:
          $ref: '#/components/schemas/Amount'
          description: Realized profit/loss
        bodPosition:
          type: string
          format: int64
          description: Beginning of day position
        expired:
          type: boolean
          description: Whether the position has expired
        updateTime:
          type: string
          format: date-time
          description: Last update timestamp
        marketMetadata:
          $ref: '#/components/schemas/MarketMetadata'
        cashValue:
          $ref: '#/components/schemas/Amount'
          description: Unrealized PnL for the position
        qtyAvailable:
          type: string
          format: int64
          nullable: true
          description: Quantity available to trade
      description: User's trading position information
    MarketMetadata:
      type: object
      properties:
        slug:
          type: string
          description: Market slug
        icon:
          type: string
          description: Market image URL
        title:
          type: string
          description: Market title
        outcome:
          type: string
          description: Market outcome
        eventSlug:
          type: string
          description: Event slug

````