poolTest

Returns 10 DEX trades on Ethereum, where buy currency smart contract is 0xC02a…6Cc2 or 0xA0b8…eB48, sell currency smart contract is 0xC02a…6Cc2 or 0xA0b8…eB48 and DEX protocol name is uniswap_v2: smart contract, protocol name, protocol version, buy currency name, buy currency symbol, buy smart contract, sell currency name and 3 more fields.

By David · saved 11 May 2025 · run 5 times · Bitquery API v2

What it returns

Filters

The query

query PoolsWithTokens($chain: evm_network, $protocolName: String) {
EVM(dataset: combined, network: $chain) {
    DEXTrades(
      limit: {count: 10}
      where: {
        Trade: {Buy: {Currency: {SmartContract: {in: ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]}}}, Sell: {Currency: {SmartContract: {in: ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]}}}, 
        Dex: {ProtocolName: {is: $protocolName}}
      }
      }
      limitBy: {by: Trade_Dex_SmartContract, count: 1}
    ) {
      Trade {
        PoolData: Dex {
          PoolAddress: SmartContract
          ProtocolName
          ProtocolVersion
        }
        Token1: Buy {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
        Token2: Sell {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
      }
      ChainId
    }
  }
}

Variables

{
  "chain": "eth",
  "protocolName": "uniswap_v2"
}

Similar queries