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

# DEX Trades Historical

> Retrieves the historical (time series) DEX trades.



## OpenAPI

````yaml get /dex/trades
openapi: 3.1.0
info:
  title: Defi API
  version: '2'
servers:
  - url: https://api.amberdata.com/defi
security:
  - sec0: []
paths:
  /dex/trades:
    get:
      summary: DEX Trades Historical
      description: Retrieves the historical (time series) DEX trades.
      operationId: dex-trades-all-blockchains
      parameters:
        - name: startDate
          in: query
          description: 'Filter by trades after this date.<br><br>**Examples**: `2025-02-05`'
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: >-
            Filter by trades before this date.<br><br>If `endDate` is not
            specified but `startDate` is, the endpoint will return trades
            spanning from `startDate` to the **now** i.e. the time the request
            was made.
          schema:
            type: string
            format: date-time
        - name: blockchain
          in: query
          description: Filter for trades on just this network/blockchain.
          required: true
          schema:
            type: string
            enum:
              - ethereum-mainnet
              - polygon-mainnet
              - arbitrum-mainnet
              - bnb-mainnet
              - optimism-mainnet
              - avalanche-mainnet
            default: ethereum-mainnet
        - name: protocolName
          in: query
          description: >-
            Filter for trades from this protocol. Use the [DEX
            Information](https://docs.amberdata.io/reference/dex-all-blockchains-information)
            endpoint to see available protocols.
          schema:
            type: string
        - name: liquidityPoolAddress
          in: query
          description: Filter by the smart contract address of the liquidity pool
          schema:
            type: string
        - name: assetBoughtAddress
          in: query
          description: >-
            Filter by the smart contract address of the asset that was bought in
            the trade
          schema:
            type: string
        - name: assetSoldAddress
          in: query
          description: >-
            Filter by the smart contract address of the asset that was sold in
            the trade
          schema:
            type: string
        - name: walletAddress
          in: query
          description: >-
            Filter by a specific address that was either the initiator or
            recipient of the trade
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                    default: 0
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            assetBoughtAddress:
                              type: string
                              example: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
                            assetBoughtAmount:
                              type: string
                              example: '16.1794651319315006'
                            assetBoughtAmountRaw:
                              type: string
                              example: '16179465131931500625'
                            assetBoughtDecimals:
                              type: integer
                              example: 18
                            assetBoughtPrice:
                              type: string
                              example: '0.000000000054573194'
                            assetBoughtSymbol:
                              type: string
                              example: weth
                            assetPair:
                              type: string
                              example: >-
                                0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3
                            assetSoldAddress:
                              type: string
                              example: '0x761d38e5ddf6ccf6cf7c55759d5210750b5d60f3'
                            assetSoldAmount:
                              type: string
                              example: '296472755569.2866327389741926'
                            assetSoldAmountRaw:
                              type: string
                              example: '296472755569286632738974192626'
                            assetSoldDecimals:
                              type: integer
                              example: 18
                            assetSoldPrice:
                              type: string
                              example: '18324014616.785653102374439753'
                            assetSoldSymbol:
                              type: string
                              example: elon
                            blockNumber:
                              type: integer
                              example: 21440571
                            blockchain:
                              type: string
                              example: ethereum-mainnet
                            callerAddress:
                              type: string
                              example: '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'
                            event:
                              type: string
                              example: >-
                                Swap (index_topic_1 address sender, uint256
                                amount0In, uint256 amount1In, uint256
                                amount0Out, uint256 amount1Out, index_topic_2
                                address to)
                            liquidityPoolAddress:
                              type: string
                              example: '0x7b73644935b8e68019ac6356c40661e1bc315860'
                            logIndex:
                              type: integer
                              example: 4
                            project:
                              type: string
                              example: uniswap
                            protocolName:
                              type: string
                              example: uniswap_v2
                            receiverAddress:
                              type: string
                              example: '0xa568bd1f7038bdea2fca05881168eef8fd4ffa33'
                            timestamp:
                              type: string
                              example: '2024-12-20T01:52:47.000Z'
                            tradeFeeBought:
                              type: string
                              example: '0.048538395395794502'
                            tradeFeeSold:
                              type: string
                              example: '889418266.707859898216922578'
                            tradeId:
                              type: string
                              example: >-
                                0x6a1bfd5881c74188933ee27ee95af994457fd4a96c9b65f7b1505c06306390c5_4
                            transactionFee:
                              type: string
                              example: '1982124877779670'
                            transactionFromAddress:
                              type: string
                              example: '0xa568bd1f7038bdea2fca05881168eef8fd4ffa33'
                            transactionGasPrice:
                              type: string
                              example: '20035630019'
                            transactionGasUsed:
                              type: string
                              example: '98930'
                            transactionHash:
                              type: string
                              example: >-
                                0x6a1bfd5881c74188933ee27ee95af994457fd4a96c9b65f7b1505c06306390c5
                            transactionToAddress:
                              type: string
                              example: '0x7a250d5630b4cf539739df2c5dacb4c659f2488d'
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      x-default: API_KEY
      name: x-api-key

````