sellsideissue

Returns the latest DEX trades on Ethereum, where buy currency smart contract is 0xc02a…6cc2, buy seller is 0x9dda…2c42 and buy currency smart contract is not 0x9dda…2c42: block number, block time, from, to, transaction hash, buy amount, buy buyer and 12 more fields.

By Oluwatomisin · saved 20 December 2023 · run 5 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($account: String!, $network: evm_network!, $date: DateTime) {
  EVM(dataset: combined, network: $network) {
    buyside: DEXTrades(
      orderBy: {descending: Block_Time}
      where: {Trade: {Buy: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}, Seller: {is: $account}}}, Block: {Time: {since: $date}}}
    ) {
      Block {
        Number
        Time
      }
      Transaction {
        From
        To
        Hash
      }
      Trade {
        Buy {
          Amount
          Buyer
          Currency {
            Name
            Symbol
            SmartContract
          }
          Seller
          Price
        }
        Sell {
          Amount
          Buyer
          Currency {
            Name
            SmartContract
            Symbol
          }
          Seller
          Price
        }
      }
    }
    sellside: DEXTrades(
      orderBy: {descending: Block_Time}
      where: {Trade: {Buy: {Currency: {SmartContract: {not: $account}}, Seller: {is: "0x9dda370f43567b9c757a3f946705567bce482c42"}}, Sell: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}, Buyer: {is: "0x9dda370f43567b9c757a3f946705567bce482c42"}}}, Block: {Time: {since: $date}}}
    ) {
      Block {
        Number
        Time
      }
      Transaction {
        From
        To
        Hash
      }
      Trade {
        Buy {
          Amount
          Buyer
          Currency {
            Name
            Symbol
            SmartContract
          }
          Seller
          Price
        }
        Sell {
          Amount
          Buyer
          Currency {
            Name
            SmartContract
            Symbol
          }
          Seller
          Price
        }
      }
    }
  }
}

Variables

{  "account": "0x9dda370f43567b9c757a3f946705567bce482c42",
  "network": "eth",  "date": "2023-06-20T00:00:00Z"
}

Similar queries