All pools of a token on pancake swap

All pools of a token

Returns DEX trades by token on BNB Chain, where currency smart contract is 0x0e09…ce82, side currency smart contract is 0xbb4c…095c and DEX owner address is 0x0bfb…1865, sorted by amount, highest first: currency name, smart contract, side currency name, side smart contract, owner address, protocol family, protocol name and 4 more fields.

By Kshitij Mahajan · saved 11 April 2025 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query pairDexList($network: evm_network, $token: String, $base: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime, $time_ago: DateTime, $owner: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "amount"}
      where: {TransactionStatus: {Success: true}, Trade: {Currency: {SmartContract: {is: $base}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Dex: {OwnerAddress: {is: $owner}}}, Block: {Time: {after: $time_ago}}}
    ) {
      Trade {
        Currency {
          Name
          SmartContract
        }
        Side {
          Currency {
            Name
            SmartContract
          }
        }
        Dex {
          OwnerAddress
          ProtocolFamily
          ProtocolName
          SmartContract
        }
        price_last: PriceInUSD(maximum: Block_Number)
        price_10min_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_10min_ago}}}
        )
        price_1h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_1h_ago}}}
        )
        price_3h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_3h_ago}}}
        )
      }
      amount: sum(of: Trade_Side_AmountInUSD)
      pairs: uniq(of: Trade_Side_Currency_SmartContract)
      trades: count
    }
  }
}

Variables

{
  "network": "bsc",
  "owner": "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865",
  "base": "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
  "token": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "time_10min_ago": "2025-04-10T09:03:33Z",
  "time_1h_ago": "2025-04-10T08:13:33Z",
  "time_3h_ago": "2025-04-10T06:13:33Z",
  "time_ago": "2025-04-07T09:13:33Z"
}

Similar queries