Subscription pair last trades

Streams DEX trades on Arbitrum as they happen, where sell currency smart contract is 0xff97…5cc8 and buy currency smart contract is 0x82af…bab1: chain ID, block time, block number, transaction hash, sell buyer, sell amount, sell amount in USD and 14 more fields.

By Nadia · saved 20 February 2025 · Bitquery API v2

What it returns

Filters

The subscription

subscription ($network: evm_network!, $mempool: Boolean, $baseCurrency: String!, $quoteCurrency: String!) {
  EVM(network: $network, mempool: $mempool) {
    DEXTrades(
      where: {Trade: {Sell: {Currency: {SmartContract: {is: $baseCurrency}}}, Buy: {Currency: {SmartContract: {is: $quoteCurrency}}}}}
    ) {
      ChainId
      Block {
        Time
        Number
      }
      Transaction {
        Hash
      }
      Trade {
        Sell {
          Buyer
          Amount
          AmountInUSD
          Currency {
            Symbol
            Name
            SmartContract
          }
        }
        Buy {
          Price
          PriceInUSD
          Amount
          AmountInUSD
          Currency {
            Symbol
            Name
            SmartContract
          }
        }
        Dex {
          ProtocolName
          SmartContract
          ProtocolFamily
          ProtocolVersion
        }
      }
    }
  }
}

Variables

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

Similar queries