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

# Get Onchain Trades

> API reference for GET /api/v1/onchain-trades



## OpenAPI

````yaml GET /api/v1/onchain-trades
openapi: 3.1.0
info:
  title: prediction-markets-api
  description: API for prediction markets
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://dev-prediction-markets-api.dflow.net
security:
  - api_key: []
tags:
  - name: Candlesticks
    description: Market and event candlesticks relay endpoints
  - name: Events
    description: Event management endpoints
  - name: Markets
    description: Market management endpoints
  - name: Trades
    description: Trade history endpoints
  - name: Series
    description: Series template endpoints
  - name: Tags
    description: Tag and category endpoints
  - name: Sports
    description: Sports filtering endpoints
  - name: Live Data
    description: Live data relay endpoints
  - name: Orderbook
    description: Orderbook endpoints
  - name: Search
    description: Full-text search endpoints
paths:
  /api/v1/onchain-trades:
    get:
      tags:
        - Trades
      summary: Get list of onchain fills
      description: >-
        Returns a paginated list of onchain fill events from the order_events
        table.

        Can be filtered by wallet address, mint address, or market ticker.
      operationId: onchain_trades
      parameters:
        - name: limit
          in: query
          description: Maximum number of trades to return (1-250, default 100)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: cursor
          in: query
          description: Pagination cursor (trade ID) to start from
          required: false
          schema:
            type: string
        - name: wallet
          in: query
          description: Filter by wallet address
          required: false
          schema:
            type: string
        - name: mint
          in: query
          description: Filter by mint address (input_mint or output_mint)
          required: false
          schema:
            type: string
        - name: ticker
          in: query
          description: Filter by market ticker
          required: false
          schema:
            type: string
        - name: sortBy
          in: query
          description: >-
            Sort by column: "createdAt" (default), "inputAmount", or
            "outputAmount"
          required: false
          schema:
            type: string
        - name: sortOrder
          in: query
          description: 'Sort direction: "desc" (default) or "asc"'
          required: false
          schema:
            type: string
        - name: minAmount
          in: query
          description: >-
            Minimum trade amount in raw token units (6 decimals). Matches if
            input_amount or output_amount >= this value.
          required: false
          schema:
            type: integer
            format: int64
        - name: maxAmount
          in: query
          description: >-
            Maximum trade amount in raw token units (6 decimals). Matches if
            input_amount or output_amount <= this value.
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: List of onchain trades
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiOnchainTradeResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MultiOnchainTradeResponse:
      type: object
      required:
        - trades
      properties:
        cursor:
          type:
            - string
            - 'null'
        trades:
          type: array
          items:
            $ref: '#/components/schemas/OnchainTradeResponse'
    ErrorResponse:
      type: object
      required:
        - msg
        - code
      properties:
        code:
          type: string
        msg:
          type: string
    OnchainTradeResponse:
      type: object
      required:
        - id
        - createdAt
        - eventType
        - orderAccount
        - inputMint
        - outputMint
        - inputAmount
        - outputAmount
        - feeMint
        - feeAmount
        - transactionSignature
        - wallet
        - fillRecipient
        - refundRecipient
      properties:
        contracts:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Number of outcome token contracts traded, in whole units (raw amount
            / 10^6).

            Null when a stablecoin side cannot be identified.
        createdAt:
          type: integer
          format: int64
          minimum: 0
        eventType:
          type: string
          description: Order event type (always "fill")
        feeAmount:
          type: integer
          format: int64
        feeMint:
          type: string
        fillRecipient:
          type: string
        id:
          type: integer
          format: int64
        inputAmount:
          type: integer
          format: int64
        inputMint:
          type: string
        marketTicker:
          type:
            - string
            - 'null'
          description: >-
            Kalshi market ticker this trade belongs to (null if not resolvable
            from mints)
        orderAccount:
          type: string
          description: Solana account address for the order
        outputAmount:
          type: integer
          format: int64
        outputMint:
          type: string
        refundRecipient:
          type: string
        side:
          type:
            - string
            - 'null'
          description: '"yes" or "no" (null if not resolvable from mints)'
        transactionSignature:
          type: string
          description: Solana transaction signature
        usdPricePerContract:
          type:
            - number
            - 'null'
          format: double
          description: >-
            USD price per outcome contract (stablecoin amount / outcome token
            amount).

            Null when both sides are stablecoins, both are outcome tokens, or
            amounts are zero.
        wallet:
          type: string
          description: Wallet address of the user
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Contact hello@dflow.net to obtain an API
        key.

````