USDT transfers and trades from mempool

Example of subscription that makes 2 queries in one subscription and filtering of amount from mempool

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_above_10K: Transfers(where: {
      Transfer: {
        Amount: {
          ge: $minamount
        }
        Currency: {
          SmartContract: {
            is: $token
          }
        }
      }
    }) {
      Transaction {
        Hash
        From
        Gas
      }
      Receipt {
        GasUsed
      }
      Transfer {
        Sender
        Receiver
        Amount
      } 
    }
    trades: DEXTradeByTokens(where: {
      Trade: {
        Currency: {
          SmartContract: {
            is: $token
          }
        }
      }
    }){
      Transaction {
        Hash
        From
      }
      Receipt {
        GasUsed
      }
      Trade {
        Amount
        Buyer
        Seller
        Side {
          Currency {
            Symbol
          }
          Amount
        }
      }
    }
  }
}

Variables

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

Similar queries