spectre trades both buy sell

Returns the latest 10 DEX trades on Ethereum, where buy currency smart contract is 0x9Cf0…dAd6 and sell currency smart contract is 0x9Cf0…dAd6: block time, transaction hash, buy amount, buy buyer, buy currency name, buy seller, buy price and 5 more fields.

By Divyasshree N · saved 30 December 2023 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $limit: Int!, $baseCurrency: String!) {
  EVM(network: $network, dataset: combined) {
    buyside: DEXTrades(
      limit: {count: $limit}
      orderBy: {descending: Block_Time}
      where: {Trade: {Buy: {Currency: {SmartContract: {is: $baseCurrency}}}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Buy {
          Amount
          Buyer
          Currency {
            Name
          }
          Seller
          Price
        }
        Sell {
          Amount
          Buyer
          Currency {
            Name
          }
          Seller
          Price
        }
      }
    }
    sellside: DEXTrades(
      limit: {count: $limit}
      orderBy: {descending: Block_Time}
      where: {Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Buy {
          Amount
          Buyer
          Currency {
            Name
          }
          Seller
          Price
        }
        Sell {
          Amount
          Buyer
          Currency {
            Name
          }
          Seller
          Price
        }
      }
    }
  }
}

Variables

{
  "network": "eth",
  "limit": 10,
  "baseCurrency": "0x9Cf0ED013e67DB12cA3AF8e7506fE401aA14dAd6"
}

Similar queries