Query for address contacted with a smart contract

{
ethereum(network: bsc_testnet) {
smartContractCalls(
caller: {is: “0x0e8492d5566365236f0E179fd6956fe87c6AC3EB”}
smartContractAddress: {is: “0x2d4ee064ebb491b1e6db6ea1962db59d1d0e0741”}

) {
  block {
    timestamp {
      time(format: "%Y-%m-%d %H:%M:%S")
    }
    height
  }
  smartContractMethod {
    name
    signatureHash
  }
  address: caller {
    address
    annotation
  }
  transaction {
    hash
  }
  gasValue
  external
}

}
}

This query gives output of txn hash and various other information of each txn. What can I add so we can also get the amount of each token traded in each txn as it showing other information for each txn. I want to get all this information from this query only. How can I do that?

You can do that by adding the amount field in your GraphQL query

{
  ethereum(network: bsc_testnet) {
    smartContractCalls(
      caller: {is: "0x0e8492d5566365236f0E179fd6956fe87c6AC3EB"}
      smartContractAddress: {is: "0x2d4ee064ebb491b1e6db6ea1962db59d1d0e0741"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      smartContractMethod {
        name
        signatureHash
      }
      address: caller {
        address
        annotation
      }
      transaction {
        hash
      }
      gasValue
      external
      amount(in: USD)
    }
  }
}

That will just show the USD value of gas used not the tokens traded

I guess in order to get the gas value, the gasValue field comes into play. I guess adding a count field with unique transactions should do the work

{
  ethereum(network: bsc_testnet) {
    smartContractCalls(
      caller: {is: "0x0e8492d5566365236f0E179fd6956fe87c6AC3EB"}
      smartContractAddress: {is: "0x2d4ee064ebb491b1e6db6ea1962db59d1d0e0741"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      smartContractMethod {
        name
        signatureHash
      }
      address: caller {
        address
        annotation
      }
      transaction {
        hash
      }
      gasValue
      external
      count(uniq: txs)
    }
  }
}

For getting DEX trade related data, you need to use DEXTRADES API

For example.

{
  ethereum(network: bsc_testnet) {
    dexTrades(
      txSender: {is: "0x0e8492d5566365236f0e179fd6956fe87c6ac3eb"}
    ) {
      transaction {
        hash
      }
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      date {
        date
      }
      block {
        height
      }
      buyAmount
      buyAmountInUsd: buyAmount(in: USD)
      buyCurrency {
        symbol
        address
      }
      sellAmount
      sellAmountInUsd: sellAmount(in: USD)
      sellCurrency {
        symbol
        address
      }
      sellAmountInUsd: sellAmount(in: USD)
      tradeAmount(in: USD)
      transaction {
        gasValue
        gasPrice
        gas
      }
    }
  }
}