> ## 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 wallet and/or token on a single chain.



## OpenAPI

````yaml post /v1/evm/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/evm/dex/trades/get-trades:
    post:
      tags:
        - EVM DEX
      summary: Get Trades
      description: Returns trades for a wallet and/or token on a single chain.
      operationId: evmGetTrades
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  required:
                    - chain_id
                  properties:
                    chain_id:
                      type: integer
                      description: >-
                        Numeric EVM chain ID to query. See [Supported
                        Chains](/documentation/evm/overview#supported-chains).
                    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:
                  chain_id: 1
                  wallet: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                  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/EvmDexTrade'
        '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
    EvmDexTrade:
      x-fern-type-name: EvmDexTrade
      type: object
      properties:
        id:
          type: integer
        chain_id:
          type: integer
          description: Numeric EVM chain ID the record belongs to.
        protocol:
          $ref: '#/components/schemas/EvmDexProtocolField'
        swap_type:
          $ref: '#/components/schemas/EvmDexSwapTypeEnum'
        wallet_address:
          type: string
        token_address:
          type: string
        quote_address:
          type: string
        position_address:
          type: string
        direction:
          $ref: '#/components/schemas/EvmDexTradeDirectionEnum'
        position_state:
          $ref: '#/components/schemas/EvmDexTradePositionStateEnum'
        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_number:
          type: integer
        block_time:
          type: string
          format: date-time
        tx_hash:
          type: string
    EvmDexProtocolField:
      x-fern-type-name: EvmDexProtocolField
      type: string
      description: >-
        Refer to [Data Sources](/documentation/evm/dex/overview#data-sources)
        for the list of supported protocols.
    EvmDexSwapTypeEnum:
      x-fern-type-name: EvmDexSwapTypeEnum
      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
    EvmDexTradeDirectionEnum:
      x-fern-type-name: EvmDexTradeDirectionEnum
      type: string
      enum:
        - buy
        - sell
      x-enum-descriptions:
        - Trader bought a token.
        - Trader sold a token.
    EvmDexTradePositionStateEnum:
      x-fern-type-name: EvmDexTradePositionStateEnum
      type: string
      enum:
        - open
        - close
        - trade
        - unknown
      x-enum-descriptions:
        - Trader opened a position.
        - Trader closed a position.
        - Trader executed a trade against a position.
        - >-
          Position state could not be determined, because the token balances
          around the trade were unavailable.
  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

````