Dex_trades add primary index Trade_Dex_ProtocolName Trade_Dex_OwnerAddress

Returns DEX trades on BNB Chain, where DEX owner address is 0xca14…0c73, DEX protocol name is uniswap_v2 and block time after 2025-05-17: buy currency symbol, buy smart contract, sell currency symbol, sell smart contract, average of trade buy price, sum of trade buy amount and sum of trade sell amount.

By Remach · saved 19 May 2025 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query Pairs($network: evm_network, $exchangeName: String!, $ownerAddress: [String!], $from: DateTime!, $minTradeAmount: String!, $fromPrice: DateTime!) {
  EVM(network: $network, dataset: combined) {
    DEXTrades(
      where: {Trade: {Dex: {ProtocolName: {is: $exchangeName}, OwnerAddress: {in: $ownerAddress}}, Buy: {AmountInUSD: {gt: $minTradeAmount}}}, Block: {Time: {after: $from}}, TransactionStatus: {Success: true}}
    ) {
      Trade {
        Buy {
          Currency {
            Symbol
            SmartContract
          }
        }
        Sell {
          Currency {
            Symbol
            SmartContract
          }
        }
      }
      buyPrice: average(of: Trade_Buy_Price, if: {Block: {Time: {after: $fromPrice}}})
      buyAmount: sum(of: Trade_Buy_Amount)
      sellAmount: sum(of: Trade_Sell_Amount)
    }
  }
}

Variables

{
  "exchangeName": "uniswap_v2",
  "from": "2025-05-17T11:07:02.371Z",
  "fromPrice": "2025-05-18T11:02:02.371Z",
  "minTradeAmount": "10",
  "network": "bsc",
  "ownerAddress": "0xca143ce32fe78f1f7019d7d551a6402fc5350c73"
}

Similar queries