example 2 queries in one subscription

Streams transfers and DEX trades by token on Ethereum as they happen, where currency smart contract is 0xdac1…1ec7 and transfer amount is at least 10000: sender, receiver, transfer amount, trade amount, buyer and seller.

By Aleksey · saved 16 February 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The subscription

subscription($token: String!, $minamount: String!, $mempool: Boolean, $network: evm_network!) {
  usdt: EVM(network: $network, mempool: $mempool) {
    transfers: Transfers(where: {
      Transfer: {
        Amount: {
          ge: $minamount
        }
        Currency: {
          SmartContract: {
            is: $token
          }
        }
      }
    }) {
      above_10K: Transfer {
        Sender
        Receiver
        Amount
      } 
    }
    trades: DEXTradeByTokens(where: {
      Trade: {
        Currency: {
          SmartContract: {
            is: $token
          }
        }
      }
    }){
      Trade {
        Amount
        Buyer
        Seller
      }
    }
  }
}

Variables

{
  "token": "0xdac17f958d2ee523a2206206994597c13d831ec7", 
  "minamount": "10000", 
  "mempool": true,
	"network": "eth"
}

Similar queries