sells and buys

WETH/Qrolli

Returns 20 DEX trades by token on Ethereum, where currency smart contract is 0x5149…86CA and transaction time after 2024-10-20, sorted by trade currency smart contract, highest first: smart contract and sum of trade side amount in USD.

By Zygis · saved 21 October 2024 · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $offset: Int!, $pageSize: Int!, $addresses: [String!], $date: DateTime!) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descending: Trade_Currency_SmartContract}
      limit: {count: $pageSize, offset: $offset}
      where: {Trade: {Currency: {SmartContract: {in: $addresses}}}, Transaction: {Time: {after: $date}}, TransactionStatus: {Success: true}}
    ) {
      Trade {
        Currency {
          SmartContract
        }
      }
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
    }
  }
}

Variables

{
  "network": "eth",
  "offset": 0,
  "pageSize": 20,
  "addresses": ["0x514910771AF9Ca656af840dff83E8264EcF986CA"],
  "date": "2024-10-20T00:00:00Z"
}

Similar queries