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

# Get Trades

> Returns trades for a combination of wallet, token and/or pool.



## OpenAPI

````yaml post /v1/solana/dex/trades/get-trades
openapi: 3.1.0
info:
  version: 1.0.1
  title: Prism API v1
servers:
  - url: https://refract.prismapi.io
    x-fern-server-name: production
security: []
paths:
  /v1/solana/dex/trades/get-trades:
    post:
      tags:
        - Solana DEX
      summary: Get Trades
      description: Returns trades for a combination of wallet, token and/or pool.
      operationId: getTrades
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    wallet:
                      type: string
                      description: Wallet address to filter trades by.
                    token:
                      type: string
                      description: Token address to filter trades by.
                - $ref: '#/components/schemas/PayloadPagination'
            examples:
              default:
                value:
                  wallet: suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK
                  limit: 20
      responses:
        '200':
          description: List of trades.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/SolanaDexTrade'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - HttpApiKeyAuth: []
components:
  schemas:
    PayloadPagination:
      type: object
      properties:
        limit:
          type: integer
          description: Maximum number of results to return in a single page.
          minimum: 1
          maximum: 100
          default: 20
        cursor:
          type: string
          description: >-
            Opaque cursor returned by a previous response. Pass it to fetch the
            next page of results.
    PaginatedResponse:
      type: object
      properties:
        count:
          type: integer
          description: Total number of matching items
        cursor:
          type: string
          description: Cursor for pagination
    SolanaDexTrade:
      x-fern-type-name: SolanaDexTrade
      type: object
      properties:
        id:
          type: integer
        protocol:
          $ref: '#/components/schemas/SolanaDexProtocolField'
        swap_type:
          $ref: '#/components/schemas/SolanaDexSwapTypeEnum'
        wallet_address:
          type: string
        token_address:
          type: string
        quote_address:
          type: string
        position_address:
          type: string
        direction:
          $ref: '#/components/schemas/SolanaDexTradeDirectionEnum'
        position_state:
          $ref: '#/components/schemas/SolanaDexTradePositionStateEnum'
        token_amount:
          type: number
        quote_amount:
          type: number
        native_amount:
          type: number
        usd_amount:
          type: number
        pre_token_balance:
          type: number
        post_token_balance:
          type: number
        token_price:
          type: number
        quote_price:
          type: number
        token_mcap:
          type: number
        block_slot:
          type: integer
        block_time:
          type: string
          format: date-time
        tx_hash:
          type: string
    SolanaDexProtocolField:
      x-fern-type-name: SolanaDexProtocolField
      type: string
      description: >-
        Refer to [Data Sources](/documentation/solana/dex/overview#data-sources)
        for the list of supported protocols.
    SolanaDexSwapTypeEnum:
      x-fern-type-name: SolanaDexSwapTypeEnum
      type: string
      enum:
        - quote_token
        - token_quote
        - token_token
        - quote_quote
      x-enum-descriptions:
        - Quote (sell) to token (buy) swap
        - Token (sell) to quote (buy) swap
        - Token (sell) to token (buy) swap
        - Quote (sell) to quote (buy) swap
    SolanaDexTradeDirectionEnum:
      x-fern-type-name: SolanaDexTradeDirectionEnum
      type: string
      enum:
        - buy
        - sell
      x-enum-descriptions:
        - Trader bought a token.
        - Trader sold a token.
    SolanaDexTradePositionStateEnum:
      x-fern-type-name: SolanaDexTradePositionStateEnum
      type: string
      enum:
        - open
        - close
        - trade
      x-enum-descriptions:
        - Trader opened a position.
        - Trader closed a position.
        - Trader executed a trade against a position.
  responses:
    BadRequest:
      description: 'Bad request: Invalid request parameters'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Bad request: Invalid request parameters'
    Unauthorized:
      description: 'Unauthorized: Invalid or missing API key'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Unauthorized: Invalid or missing API key'
    Forbidden:
      description: 'Forbidden: Access denied for the current API plan'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Forbidden: Access denied for the current API plan'
    TooManyRequests:
      description: 'Too many requests: Rate limit exceeded'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Too many requests: Rate limit exceeded'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Internal server error
  securitySchemes:
    HttpApiKeyAuth:
      type: apiKey
      name: x-api-key
      description: >-
        Your Prism API key. You can get one for free in the [Prism
        Dashboard](https://dashboard.prismapi.io).
      in: header

````