query_v1_to_v2_test_simplified

Returns one transfer on Ethereum, where currency smart contract is 0x3b60…3e5e, transfer sender is 0x0000…0000 and transfer sender is 0x0000…0000 or 0x0000…dead: sum of transfer amount, currency symbol and currency name.

By lukas · saved 25 September 2023 · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(dataset: combined, network: eth) {
    ...DEXTradeDetails
    minted: Transfers(
      where: {Transfer: {Currency: {SmartContract: {is: "0x3b6060850d818adbcfff23d5b42c855eff043e5e"}}, Amount: {gt: "0"}, Sender: {is: "0x0000000000000000000000000000000000000000"}}}
    ) {
      sum(of: Transfer_Amount)
    }
    burned: Transfers(	
      where: {Transfer: {Currency: {SmartContract: {is: "0x3b6060850d818adbcfff23d5b42c855eff043e5e"}}, Amount: {gt: "0"}, Sender: {in: ["0x0000000000000000000000000000000000000000", "0x000000000000000000000000000000000000dead"]}}}
    ) {
      sum(of: Transfer_Amount)
    }
    currency: Transfers(
      where: {Transfer: {Currency: {SmartContract: {is: "0x3b6060850d818adbcfff23d5b42c855eff043e5e"}}}}
      limit: {count: 1}
    ) {
      Transfer {
        Currency {
          Symbol
          Name
        }
      }
    }
  }
}

fragment DEXTradeDetails on EVM {
  DEXTrades(
    where: {Trade: {Buy: {Currency: {SmartContract: {is: "0x3b6060850d818adbcfff23d5b42c855eff043e5e"}}}, Sell: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}}}
    orderBy: {descending: Block_Number, descendingByField: "Transaction_Index"}
    limit: {count: 1}
  ) {
    Block {
      Number
      Time
    }
    Transaction {
      Index
    }
    Trade {
      Buy {
        Currency {
          Symbol
        }
        Price
      }
      Sell {
        Currency {
          Name
        }
        Price
      }
    }
  }
}

Similar queries