buy-info-for-pnl

Returns DEX trades, where buy currency smart contract is 0x6982…1933 and transaction from is 0x2107…9231: buy amount and buy price in USD.

By Kshitij Mahajan · saved 23 October 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String = "", $wallet: String = "") {
  EVM(dataset: combined) {
    DEXTrades(
      where: {Trade: {Buy: {Currency: {SmartContract: {is: $token}}}}, Transaction: {From: {is: $wallet}}}
    ) {
      Trade {
        Buy {
          Amount
          PriceInUSD
        }
      }
    }
  }
}

Variables

{
  "token": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
  "wallet": "0x2107662b0eb1f95a42f47f667c6d4622fe1c9231"
}

Similar queries