Pair last trades

Returns the latest 15 DEX trades on Arbitrum, where sell currency smart contract is 0xff97…5cc8, buy currency smart contract is 0x82af…bab1 and block date since 2023-09-07: chain ID, block time, block number, sell buyer, sell amount, sell amount in USD, sell price and 16 more fields.

By Nadia · saved 20 February 2025 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network!, $baseCurrency: String!, $limit: Int, $quoteCurrency: String!, $from: String, $till: String) {
  EVM(network: $network, dataset: combined) {
    DEXTrades(
      where: {Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}, Block: {Date: {since: $from, till: $till}}}
      orderBy: {descending: Block_Time}
      limit: {count: $limit}
    ) {
      ChainId
      Block {
        Time
        Number
      }
      Trade {
        Sell {
          Buyer
          Amount
          AmountInUSD
          Price
          PriceInUSD
          Currency {
            Symbol
            Name
            SmartContract
          }
        }
        Buy {
          Price
          PriceInUSD
          Amount
          AmountInUSD
          Currency {
            Symbol
            SmartContract
            Name
          }
        }
        Dex {
          ProtocolName
          SmartContract
          ProtocolFamily
          ProtocolVersion
        }
      }
      Transaction {
        Hash
      }
    }
  }
}

Variables

{
  "network": "arbitrum",
  "limit": 15,
  "from": "2023-09-07",
  "till": "2023-09-07",
  "baseCurrency": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
  "quoteCurrency": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
}

Similar queries