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

# List Account Trades

> Returns paginated trade history — each entry is a matched fill between two orders.



## OpenAPI

````yaml GET /v1/accounts/{account_id}/trades
openapi: 3.0.3
info:
  title: Predicta Markets API
  description: >-
    The Predicta Markets REST API lets you build on top of a continuous
    double-auction prediction market platform. Users buy and sell shares in
    YES/NO outcomes of real-world events. When a market resolves, holders of the
    winning side receive payouts; holders of the losing side lose their stake.


    Data model hierarchy: Market → MarketAsset → MarketAssetOption (prediction
    key) → Order. A Market is a question about a real-world event (e.g. 'Will
    Arsenal win the Premier League?'). Each Market contains one or more
    MarketAssets — the tradeable outcomes. Simple binary markets have a single
    asset; multi-player markets (e.g. Player of the Match) have one asset per
    candidate. Each MarketAsset exposes two options, YES and NO, each carrying a
    prediction_key — the unique hash you pass when placing an order to identify
    exactly which outcome you are trading.


    Trading flow: (1) call GET /v1/markets to find a market; (2) inspect
    market_assets and their options to get the prediction_key for the outcome
    you want; (3) call POST /v1/markets/{market_id}/orders with that
    prediction_key, your price, and quantity. Orders match immediately when a
    counterparty exists, otherwise they rest as open limit orders in the order
    book.


    Price system: all prices are integers in the range 1–99, representing cents.
    Price equals implied probability in percent — a YES price of 65 means the
    market implies a 65% chance the event will occur. YES and NO prices for the
    same asset always sum to approximately 100.


    Currency: the platform's internal unit is PT (Predicta Token). Balances,
    prices, and payout amounts are expressed in PT unless the market was created
    with a real-currency denomination.


    QID system: many resources expose a human-readable qualified ID (qid)
    alongside the numeric id. QIDs are computed, not stored as database columns.
    Prefix conventions — MA: market, MAA: market asset, AP: account payout. Most
    path parameters accept either the numeric id or the qid interchangeably.


    Authentication: include your API key in the X-Api-Key request header. All
    account-scoped endpoints require authentication. Market listing and detail
    endpoints are public.
  version: 1.0.0
  contact:
    email: api-support@predictamarkets.com
servers:
  - url: https://api.predictamarkets.com
    description: Production
security: []
paths:
  /v1/accounts/{account_id}/trades:
    get:
      tags:
        - Account
      summary: List Account Trades
      description: >-
        Returns paginated trade history — each entry is a matched fill between
        two orders.
      operationId: get_account_trades
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TQID'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 10
            title: Limit
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            default: 0
            title: Skip
      responses:
        '200':
          description: List of trades
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketAssetTradeSchema'
                title: Response Get Account Trades
              example:
                - id: 201
                  market_id: 12
                  market_asset_id: 34
                  buyer_account_id: 1042
                  seller_account_id: 1099
                  price: '65.00'
                  quantity: '10.00'
                  created_at: '2025-04-10T09:01:00Z'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Not authenticated
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: You are not authorized to access this account
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - apiKey: []
components:
  schemas:
    TQID:
      anyOf:
        - type: string
        - type: integer
      description: >-
        Flexible identifier type that accepts either a numeric integer ID or a
        human-readable qualified ID string (QID). QIDs follow a prefix
        convention: MA for markets, MAA for market assets, AP for account
        payouts. Most path parameters that accept an ID use this type so callers
        can use whichever form is more convenient.
    MarketAssetTradeSchema:
      properties:
        id:
          title: Id
          description: Primary key, auto-generated
          type: integer
          nullable: true
        qid:
          title: Qid
          description: Query identifier
          type: string
          nullable: true
        market_asset_id:
          title: Market Asset Id
          description: Market asset ID
          type: integer
          nullable: true
        yes_order_id:
          title: Yes Order Id
          description: >-
            ID of the order on the YES side of this trade. The YES order holder
            believes the event will occur.
          type: integer
          nullable: true
        no_order_id:
          title: No Order Id
          description: ID of the order on the NO side of this trade.
          type: integer
          nullable: true
        yes_trade_price:
          title: Yes Trade Price
          description: YES trade price
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
        no_trade_price:
          title: No Trade Price
          description: NO trade price
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
        trade_quantity:
          title: Trade Quantity
          description: Quantity traded
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
        trade_cost:
          title: Trade Cost
          description: Total cost of the trade
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
        trade_timestamp:
          type: string
          format: date-time
          title: Trade Timestamp
          description: Timestamp of the trade
        yes_account_id:
          title: Yes Account Id
          description: Account ID of the participant who held the YES side of this trade.
          type: integer
          nullable: true
        no_account_id:
          title: No Account Id
          description: Account ID of the participant who held the NO side of this trade.
          type: integer
          nullable: true
        seller_account_id:
          title: Seller Account Id
          description: >-
            Account ID of the sell-side participant in this trade. In the
            continuous double auction, this is the account that placed the SELL
            order that was matched.
          type: integer
          nullable: true
        buyer_account_id:
          title: Buyer Account Id
          description: >-
            Account ID of the buy-side participant in this trade — the account
            that placed the BUY order that triggered the match.
          type: integer
          nullable: true
        asset_identifier:
          title: Asset Identifier
          description: Unique asset identifier
          type: string
          nullable: true
        market_asset:
          $ref: '#/components/schemas/MarketAssetSchema'
          description: Market asset
          nullable: true
      type: object
      required:
        - trade_timestamp
        - market_asset
      title: MarketAssetTradeSchema
      description: >-
        A single matched trade between two orders. Created by the matching
        engine when a BUY and SELL order cross. Records both sides of the fill
        including prices, quantities, and the accounts on each side.
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message
      required:
        - detail
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: >-
        Returned by FastAPI when request validation fails (HTTP 422). Contains
        one or more ValidationError entries describing each invalid field.
    MarketAssetSchema:
      properties:
        id:
          type: integer
          title: Id
          description: The items ID
        qid:
          type: string
          title: Qid
          description: the qualified identifier
        asset_identifier:
          type: string
          title: Asset Identifier
          description: Unique asset identifier
        market_id:
          type: integer
          title: Market Id
          description: The market ID
        current_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Current Price
          description: Current price of the asset
          default: null
        yes_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Yes Price
          description: Current YES price of the asset
          default: null
        no_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: No Price
          description: Current NO price of the asset
          default: null
        volume:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          nullable: true
          title: Volume
          description: Trading volume of the asset
          default: null
        status:
          type: string
          title: Status
          description: Status of the market asset
          default: active
        title:
          title: Title
          description: >-
            Display name for this market asset. For multi-outcome markets this
            is the candidate name (e.g. 'Kylian Mbappe'). For binary markets
            this may match the market title or be null.
          type: string
          nullable: true
        options:
          title: Options
          description: Tradeable options for this market asset.
          type: array
          items:
            $ref: '#/components/schemas/MarketAssetOption'
          nullable: true
          default: null
        avatar_path:
          title: Avatar Path
          description: The avatar url
          type: string
          nullable: true
        outcome:
          $ref: '#/components/schemas/MarketAssetOutcomeSchema'
          description: Outcome of the market asset
          nullable: true
      type: object
      required:
        - id
        - qid
        - asset_identifier
        - market_id
      title: MarketAssetSchema
      description: >-
        A single tradeable outcome within a market. Binary markets have one
        asset (the question itself); multi-outcome markets have one asset per
        candidate or condition. Each asset has live YES/NO prices and a list of
        options containing the prediction_key values needed to place orders.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: >-
            Path to the invalid field as a list of keys and/or array indices.
            For example, ['body', 'price'] indicates the price field in the
            request body failed validation.
        msg:
          type: string
          title: Message
          description: Human-readable explanation of what validation rule was violated.
        type:
          type: string
          title: Error Type
          description: >-
            Machine-readable Pydantic error type (e.g. 'value_error.missing',
            'type_error.integer').
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      description: >-
        A single field validation failure within an HTTP 422 response. The loc
        array traces the path to the invalid field (e.g. ['body', 'price']).
    MarketAssetOption:
      type: object
      title: MarketAssetOption
      description: >-
        A single tradeable option within a market asset (e.g. YES / NO for
        binary markets).
      required:
        - id
        - key
      properties:
        id:
          type: string
          description: >-
            Option identifier — 'YES' / 'NO' for binary markets, or the
            condition key for multi-outcome markets.
        key:
          type: string
          description: >-
            The prediction key for this option. This is the value you supply as
            `prediction_key` when placing an order via POST
            /v1/markets/{market_id}/orders. It is a unique uppercase hex hash
            that identifies a specific tradeable outcome (e.g. the YES side of a
            particular market asset).
        value:
          type: string
          nullable: true
          description: >-
            Human-readable label for the option. Typically 'Yes' / 'No', but can
            be a full sentence (e.g. 'Yes Kylian Mbappe wins the Ballon d\'Or').
        determination_formula:
          type: string
          nullable: true
          description: >-
            Auto-determination formula used by the oracle to resolve this
            option. Present only on finance/series markets. Absent (not null) on
            simple binary markets.
      example:
        id: 'YES'
        key: B634817F0B02790D949F56F7BBDE7ECF
        value: 'Yes'
        determination_formula: '#{price} >= 4554.71'
    MarketAssetOutcomeSchema:
      properties:
        id:
          title: Id
          description: Primary key of the outcome record. Populated after resolution.
          type: integer
          nullable: true
        qid:
          title: Qid
          description: Human-readable qualified ID for this outcome record.
          type: string
          nullable: true
        winning_side:
          $ref: '#/components/schemas/MarketSides'
          description: The winning side
          nullable: true
        winning_prediction_key:
          title: Winning Prediction Key
          description: >-
            The prediction key (`market_asset.options[n].key`) of the option
            that was resolved as the winner. Holders of orders with this
            prediction key receive payouts.
          type: string
          nullable: true
        market_determined_at:
          title: Market Determined At
          description: >-
            Timestamp when the market outcome was officially determined by the
            platform. After this point the market moves toward COMPLETED/SETTLED
            status and payouts are calculated.
          type: string
          format: date-time
          nullable: true
      type: object
      title: MarketAssetOutcomeSchema
      description: >-
        Resolution outcome for a market asset. Populated after the market is
        resolved. Contains the winning side, the winning prediction_key, and the
        timestamp of determination.
    MarketSides:
      type: string
      enum:
        - 'YES'
        - 'NO'
      title: MarketSides
      description: 'The two tradeable sides of a market asset: YES or NO.'
  responses:
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            detail: An unexpected error occurred. Please try again later.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      x-default: your-api-key-here

````