Unsiwap v2 and v3 trades

Returns the latest DEX trade on Ethereum, where DEX protocol name is uniswap_v2 or uniswap_v3: from, to, protocol name, smart contract, pair name, owner address, buy currency name and 6 more fields.

By Shimpei · saved 10 August 2023 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(dataset: realtime, network: eth) {
    DEXTrades(
      where: {Trade: {Dex: {ProtocolName: {in: ["uniswap_v2", "uniswap_v3"]}}}}
      limit: {count: 1}
      orderBy: {descending: Block_Number}
    ) {
      Transaction {
        From
        To
      }
      Trade {
        Dex {
          ProtocolName
          SmartContract
          Pair {
            Name
          }
          OwnerAddress
        }
        Buy {
          Currency {
            Name
          }
          Price
          Amount
        }
        Sell {
          Amount
          Currency {
            Name
          }
          Price
        }
      }
      Block {
        Time
      }
    }
  }
}

Similar queries