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-01: chain ID, block time, block number, sell buyer, sell amount, sell currency symbol, buy price and 4 more fields.

By Nadia · saved 7 September 2023 · 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: archive) {
    sell: DEXTrades(
      where: {Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}, Block: {Date: {since: $from, till: $till}}}
      orderBy: {descending: Block_Date}
      limit: {count: $limit}
    ) {
      ChainId
      Block {
        Time
        Number
      }
      Trade {
        Sell {
          Buyer
          Amount
          Currency {
            Symbol
          }
        }
        Buy {
          Price
          Amount
          Currency {
            Symbol
          }
        }
        Dex {
          ProtocolName
          SmartContract
        }
      }
    }
  }
}

Variables

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

Similar queries