DEX trade price

Returns the latest DEX trade on Ethereum, where pair smart contract is 0x48e3…6844 and block number is at most 22617736: buy currency symbol, buy smart contract, buy fungible, buy decimals, buy currency name, buy price, buy price in USD and 11 more fields.

By Francesco Gasparetto · saved 12 September 2025 · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $blockNumber: String!, $contract: String!) {
  EVM(network: $network, dataset: archive) {
    DEXTrades(
      orderBy: {descending: Block_Time}
      where: {Trade: {Dex: {Pair: {SmartContract: {is: $contract}}}}, TransactionStatus: {Success: true}, Block: {Number: {le: $blockNumber}}}
      limit: {count: 1}
    ) {
      Trade {
        Buy {
          Currency {
            Symbol
            SmartContract
            Fungible
            Decimals
            Name
          }
          Price_against_sell_currency: Price
          Price_usd: PriceInUSD
        }
        Sell {
          Currency {
            Symbol
            SmartContract
            Fungible
            Decimals
            Name
          }
          Price_against_buy_currency: Price
          Price_usd: PriceInUSD
        }
      }
      Block {
        Date
        Number
        Time
      }
      Transaction {
        Hash
      }
    }
  }
}

Variables

{
  "network": "eth",
  "contract" : "0x48e313460dd00100e22230e56e0a87b394066844",
  "blockNumber" : "22617736"
}

Similar queries