Copy of Ethereum dextrades

Ethereum dextrades

Returns the latest 1000 events on Ethereum, where signature name is Swap and block time after 2023-11-20: block number, block time, block date, transaction hash, from, to, value in USD and 14 more fields.

By Zooper · saved 20 November 2025 · Bitquery API v2

What it returns

Filters

The query

query GetUniswapSwapsForAddress($userAddress: String!, $limit: Int = 1000) {
  # Uniswap V2 and V3 Swap Events for the last 2 years
  EVM(dataset: combined, network: eth) {
    Events(
      where: {
        Block: {
          Time: {after: "2023-11-20T00:00:00Z"}  # Last 2 years from now
        }
        Log: {
          Signature: {Name: {is: "Swap"}}
        }
        Transaction: {
          or: [
            {From: {is: $userAddress}},
            {To: {is: $userAddress}}
          ]
        }
        # Filter for known Uniswap V2/V3 router addresses in transaction
        any: [
          {
            Transaction: {
              To: {
                in: [
                  "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",  # Uniswap V2 Router
                  "0xE592427A0AEce92De3Edee1F18E0157C05861564",  # Uniswap V3 Router
                  "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"   # Uniswap V3 Router 2
                ]
              }
            }
          }
        ]
      }
      orderBy: {descending: Block_Time}
      limit: {count: $limit}
    ) {
      Block {
        Number
        Time
        Date
      }
      Transaction {
        Hash
        From
        To
        ValueInUSD
        Gas
        GasPrice
      }
      Log {
        SmartContract
        Index
        Signature {
          Name
          Signature
        }
      }
      Arguments {
        Name
        Type
        Value {
          ... on EVM_ABI_Integer_Value_Arg {
            integer
          }
          ... on EVM_ABI_String_Value_Arg {
            string
          }
          ... on EVM_ABI_Address_Value_Arg {
            address
          }
          ... on EVM_ABI_BigInt_Value_Arg {
            bigInteger
          }
          ... on EVM_ABI_Bytes_Value_Arg {
            hex
          }
          ... on EVM_ABI_Boolean_Value_Arg {
            bool
          }
        }
      }
    }
  }
}

Variables

{
  "userAddress": '0x84d7295a36e8113ea9f52d1d40ae78ba651906d6'
}

Similar queries